public abstract class Grph extends java.lang.Object implements GrphPrimitives, java.lang.Cloneable, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Grph.DIRECTION |
static class |
Grph.MaxIndependentSetAlgorithm
Implemented Maximum Independent Set algorithms.
|
static class |
Grph.MinVertexCoverAlgorithm
Implemented Minimum Vertex Cover algorithms.
|
static class |
Grph.TYPE |
Constructor and Description |
---|
Grph(java.lang.String name,
int nbVertices,
int nbEdges) |
Modifier and Type | Method and Description |
---|---|
int |
addDirectedSimpleEdge(int tail,
int head)
Adds an arc connecting the given source and destination vertices.
|
it.unimi.dsi.fastutil.ints.Int2IntMap |
addGraph(Grph otherGraph) |
void |
addHyperEdge(int edge,
int... vertices) |
it.unimi.dsi.fastutil.ints.IntSet |
addNVertices(int n)
Creates n vertices in this graph.
|
int |
addSimpleEdge(int src,
int dest,
boolean directed)
Connects the given vertices with a simple edge created on-the-fly.
|
void |
addSimpleEdge(int src,
int edge,
int dest,
boolean directed)
Connects the given vertices with the given simple edge.
|
int |
addUndirectedSimpleEdge(int v1,
int v2)
Adds an edge connecting the two given vertices.
|
int |
addVertex()
Creates a new vertex in the graph.
|
void |
addVertices(it.unimi.dsi.fastutil.ints.IntSet s) |
boolean |
areEdgesAdjacent(int a,
int b) |
boolean |
areVerticesAdjacent(int src,
int dest)
Checks if the given two vertices are connected.
|
SearchResult |
bfs(int source)
Performs a BFS from the given vertex.
|
SearchResult[] |
bfs(toools.collections.primitive.LucIntSet sources) |
it.unimi.dsi.fastutil.ints.IntArrayList |
bfsList(int sourceVertex) |
void |
chain(boolean directed)
Connect the vertices in this graph as chain.
|
void |
clear()
Clears this graph.
|
void |
clearCache()
Clears the cache for all algorithms that employs one.
|
void |
clique()
Connect all vertices in this graph as a clique.
|
void |
clique(it.unimi.dsi.fastutil.ints.IntSet s)
Connect the given set of vertices as a clique.
|
Grph |
clone()
Computes a clone of this graph.
|
MaxFlowAlgorithmResult |
computeMaxFlow(int s,
int t,
NumericalProperty weights)
Computes the maximum flow from the given source to the given destination.
|
void |
connectToKClosestNeighbors(int k)
Connect each vertex to its k-closest neighbours, according to the current
topology.
|
boolean |
contains(Grph g)
Checks if this graph contains the given graph.
|
boolean |
containsAPath(int source,
int destination) |
void |
contractEdge(int e) |
void |
contractVertices(int a,
int b) |
void |
contractVertices(int a,
int b,
boolean allowMultipleEdges) |
javax.swing.JComponent |
createSwingRenderer() |
void |
dgrid(int width,
int height)
Connect vertices currently in the graph as a DIRECTED grid of dimension
(w, h).
|
void |
disconnect(int src,
int destination)
Disconnect the two given vertices.
|
void |
disconnectVertex(int v)
Disconnect the given vertex, i.e.
|
void |
display()
Display this graph in a graphical frame, using automatic layout.
|
org.miv.graphstream.ui.GraphViewerRemote |
displayGraphstream_0_4_2()
Display this graph in a graphical frame, using GraphStream 0.4.2.
|
void |
displayImg() |
void |
displayReport() |
void |
displaySVGSalamander() |
void |
dring()
Creates a directed ring consisting of the vertices already in the graph.
|
void |
ensureNVertices(int n)
Ensure this graph has at least the specified amount of vertices.
|
boolean |
equals(Grph g)
Checks if this graph equals the given graph.
|
boolean |
equals(java.lang.Object o)
Checks if this graph contains the given graph.
|
GrphAlgorithm |
findAlgorithm(java.lang.String name) |
Property |
findPropertyByName(java.lang.String name) |
static Grph |
fromCaidaMap(toools.io.file.RegularFile f)
Builds a new graph from the given CAIDA map.
|
static Grph |
fromGraphML(java.lang.String graphMLText) |
static Grph |
fromGraphML(java.lang.String graphMLText,
java.lang.Class vPropertyClass,
java.lang.Class ePropertyClass) |
static Grph |
fromGrphBinary(byte[] text) |
static Grph |
fromGrphText(java.lang.String text) |
static Grph |
fromGrphTextFile(java.lang.String filename) |
AdjacencyMatrix |
getAdjacencyMatrix()
Computes a adjacency matrix for this graph.
|
java.util.Set<Path> |
getAllCycles() |
it.unimi.dsi.fastutil.ints.IntArrayList |
getAllInEdgeDegrees() |
it.unimi.dsi.fastutil.ints.IntArrayList |
getAllOutEdgeDegrees() |
java.util.Collection<Path> |
getAllPaths() |
double |
getAverageClusteringCoefficient()
Computes the average clustering coefficient of this graph.
|
double |
getAverageDegree()
Computes the average degree of this graph.
|
double |
getAverageDegree(Grph.TYPE type,
Grph.DIRECTION direction)
Computes the average degree of this graph.
|
Grph |
getBipartiteSubgraphInducedByVertices(it.unimi.dsi.fastutil.ints.IntSet A,
it.unimi.dsi.fastutil.ints.IntSet B) |
int |
getCenter()
Retrieves the vertex at the center of the graph.
|
void |
getCircleStar() |
java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> |
getCliques() |
double |
getClusteringCoefficient() |
double |
getClusteringCoefficient(int v) |
toools.math.Distribution<java.lang.Double> |
getClusteringCoefficientDistribution() |
Grph |
getComplement()
Computes the complement graph for this graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
getConnectedComponentContaining(int vertex,
Grph.DIRECTION direction)
Computes the connected component containing the given vertex, according
to the given search direction.
|
java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> |
getConnectedComponents()
Computes the set of connected component on this graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
getCutEdges(it.unimi.dsi.fastutil.ints.IntSet a,
it.unimi.dsi.fastutil.ints.IntSet b)
Computes the edges describing the cut formed by the two given sets.
|
int |
getCutSize(it.unimi.dsi.fastutil.ints.IntSet a,
it.unimi.dsi.fastutil.ints.IntSet b)
Compute the size of the cut.
|
static int |
getDefaultNumberOfThreads() |
toools.math.Distribution<java.lang.Integer> |
getDegreeDistribution(Grph.TYPE type,
Grph.DIRECTION dir)
Computes a degree distribution for this graph
|
double |
getDensity()
Computes the exact density of this graph.
|
java.lang.String |
getDescription()
Computes a textual description for this graph.
|
int |
getDiameter()
Computes the exact diameter of this graph.
|
java.lang.String |
getDifference(Grph g)
Compares this graph and the given graph and returns the first difference
found.
|
DistanceMatrix |
getDistanceMatrix(NumericalProperty edgeWeights)
Computes a distance matrix for this graph.
|
int |
getEccentricity(int v) |
int |
getEccentricity(int v,
NumericalProperty weights)
Computes the eccentricity of the given vertex.
|
NumericalProperty |
getEdgeColorProperty() |
int |
getEdgeDegree(int v) |
Property |
getEdgeLabelProperty() |
grph.Grph.EDGE_NATURE |
getEdgeNature(int e)
Gets the nature of the given edge (undirected simple edge, directed
simple edge, undirected hyper-edge or directed-hyperedge).
|
java.util.Collection<VertexPair> |
getEdgePairs() |
it.unimi.dsi.fastutil.ints.IntSet |
getEdgesAdjacentToEdge(int e)
Computes the set of edges incident to vertices incident to the given
edge.
|
it.unimi.dsi.fastutil.ints.IntSet |
getEdgesConnecting(int src,
int dest) |
it.unimi.dsi.fastutil.ints.IntSet |
getEdgesIncidentTo(int v)
Computes the set of edges incident to the given vertex.
|
NumericalProperty |
getEdgeStyleProperty() |
NumericalProperty |
getEdgeWidthProperty() |
int |
getFartestVertex(int v) |
int |
getFartestVertex(int v,
NumericalProperty edgeWeights) |
java.util.List<it.unimi.dsi.fastutil.ints.IntSet> |
getFringes(int numberOfHops,
int root) |
int |
getGirth()
The girth of a graph is defined as the length of a shortest cycle, or
infinite if the graph is acyclic.
|
java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> |
getGpmetisPartitionning(int numberOfPartitions,
Gpmetis.Ptype ptype,
Gpmetis.Ctype ctype,
Gpmetis.Iptype iptype,
Gpmetis.Objtype objtype,
boolean contig,
boolean minconn,
int ufactor,
int niter,
int ncuts,
java.util.Random r) |
java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> |
getGpmetisPartitionning(int numberOfPartitions,
java.util.Random r) |
it.unimi.dsi.fastutil.ints.IntSet |
getInaccessibleVertices()
Returns a set of vertices that are inaccessible (e.g.
|
toools.math.IntMatrix |
getIncidenceMatrix()
Computes a incidence matrix for this graph.
|
java.util.List<Matching> |
getInducedSubgraphIsomorphism(Grph pattern,
boolean findAllSolutions)
Returns if the given "pattern graph" is isomorphic to a subgraph in this
graph.
|
int |
getInEdgeDegree(int v) |
toools.collections.primitive.LucIntSet |
getInEdges(int v)
Computes the set of out-edges for the given vertex.
|
protected it.unimi.dsi.fastutil.ints.IntSet |
getInElements(int v) |
int[][] |
getInNeighborhoods() |
toools.collections.primitive.LucIntSet |
getInNeighbors(int v) |
it.unimi.dsi.fastutil.ints.IntSet |
getInNeighbours(int v) |
toools.collections.primitive.LucIntSet |
getInOnlyEdges(int v) |
toools.collections.primitive.LucIntSet |
getInOutOnlyEdges(int v) |
int |
getInVertexDegree(int v) |
it.unimi.dsi.fastutil.ints.IntSet |
getIsolatedVertices()
Computes the set of isolated vertices in this graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
getKClosestNeighbors(int vertex,
int k,
NumericalProperty edgeWeights) |
java.util.List<ArrayListPath> |
getKShortestPaths(int s,
int t,
int k,
NumericalProperty edgeWeights) |
it.unimi.dsi.fastutil.ints.IntSet |
getLargestConnectedComponent()
Determines the largest connected component in the graph.
|
Grph |
getLineGraph()
Computes the line graph of this graph.
|
Grph |
getLineGraph(int n)
Computes n iterations of the "line graph" operation on this graph.
|
double[] |
getLocalClusteringCoefficients() |
it.unimi.dsi.fastutil.ints.IntSet |
getLoops(int v)
Computes the set of self-loops incident to the given vertex
|
it.unimi.dsi.fastutil.ints.IntSet |
getMaximumClique()
Computes the maximum clique in this graph, using an ant-based algorithm
defined by Chistine Solnon.
|
it.unimi.dsi.fastutil.ints.IntSet |
getMaximumIndependentSet()
Computes a independent set of maximum cardinality, based on
|
it.unimi.dsi.fastutil.ints.IntSet |
getMaximumIndependentSet(Grph.MaxIndependentSetAlgorithm algorithm) |
it.unimi.dsi.fastutil.ints.IntSet |
getMaximumMatching()
Computes a maximum (cardinality) matching.
|
int |
getMaxInEdgeDegrees() |
int |
getMaxInVertexDegrees() |
int |
getMaxOutEdgeDegrees() |
int |
getMaxOutVertexDegrees() |
it.unimi.dsi.fastutil.ints.IntSet |
getMinimumVertexCover()
Computes a vertex cover of minimum cardinality.
|
it.unimi.dsi.fastutil.ints.IntSet |
getMinimumVertexCover(Grph.MinVertexCoverAlgorithm algorithm)
Computes a minimum vertex cover by applying the specified algorithm.
|
int |
getMinInEdgeDegrees() |
int |
getMinInVertexDegrees() |
int |
getMinOutEdgeDegrees() |
int |
getMinOutVertexDegrees() |
int[][] |
getNeighborhoods() |
int[][] |
getNeighbors(Grph.DIRECTION direction) |
it.unimi.dsi.fastutil.ints.IntSet |
getNeighborsAtMaxDistance(int vertex,
int maxDistance,
NumericalProperty p) |
toools.collections.primitive.LucIntSet |
getNeighbours(int v)
Computes the set of neighbors of the given vertex, cumulating in and out
neighbors.
|
toools.collections.primitive.LucIntSet |
getNeighbours(int vertex,
Grph.DIRECTION direction) |
it.unimi.dsi.fastutil.ints.IntSet |
getNeighbours(it.unimi.dsi.fastutil.ints.IntSet s)
Computes the (open) neighborhood of the set s of vertices (that is the
set of vertices that have at least one neighbour in s, and do not belong
to s)
|
it.unimi.dsi.fastutil.ints.IntSet |
getNeighboursAtMostKHops(int k,
int v) |
int |
getNumberOfDirectedEdges() |
int |
getNumberOfEdges() |
int |
getNumberOfHyperEdges() |
int |
getNumberOfSimpleEdges() |
int |
getNumberOfTriangles()
Computes the number of triangles in the graph.
|
int |
getNumberOfUndirectedEdges() |
int |
getNumberOfVertices()
Computes the number of vertices in this graph.
|
toools.collections.primitive.LucIntSet |
getOppositeEdges(int e) |
int |
getOrder()
Computes the order of this graph.
|
int |
getOutEdgeDegree(int v) |
toools.collections.primitive.LucIntSet |
getOutEdges(int v)
Computes the set of out-edges for the given vertex.
|
int[][] |
getOutNeighborhoods()
Computes the vertex adjacency of the graph in the form of a two-dimension
int array.
|
toools.collections.primitive.LucIntSet |
getOutNeighbors(int v)
Computes the set of out-neighbors of the given vertex.
|
toools.collections.primitive.LucIntSet |
getOutOnlyEdges(int v) |
int |
getOutVertexDegree(int v) |
PageRank |
getPageRanking(java.util.Random r) |
java.util.Collection<Matching> |
getPartialSubgraphIsomorphism(Grph pattern,
boolean findAllSolutions)
Returns if the given "pattern graph" is partially isomorphic to a
subgraph in this graph.
|
java.util.Collection<Property> |
getProperties()
Computes the set of properties applicable to this graph.
|
int |
getRadius()
Computes the exact radius of this graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
getShortestCycle() |
Path |
getShortestPath(int source,
int destination) |
SearchResultWrappedPath |
getShortestPath(int source,
int destination,
NumericalProperty edgeWeights)
Computes a shortest path from the given source to the given destination.
|
it.unimi.dsi.fastutil.ints.IntSet |
getSimplicialVertices()
Comptes the set of simplitial vertices in this graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
getSinks()
Computes the set of sink vertices in this graph.
|
int |
getSize() |
int |
getSomeEdgeConnecting(int src,
int dest)
Returns an (hyper)edge or arc that connects src and dest
|
it.unimi.dsi.fastutil.ints.IntSet |
getSources()
Computes the set of source vertices in this graph.
|
Grph |
getSpanningTree() |
java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> |
getStronglyConnectedComponents()
Tarjan's algorithm.
|
Grph |
getSubgraphInducedByEdges(it.unimi.dsi.fastutil.ints.IntSet edges)
Computes the subgraph induced by the given set of edges.
|
Grph |
getSubgraphInducedByVertices(it.unimi.dsi.fastutil.ints.IntSet vertices)
Computes the subgraph induced by the given set of vertices.
|
java.util.List<TopologyListener> |
getTopologyListeners()
Obtains the list of topology listeners for this graph.
|
int |
getTwoSweepBFSDiameterApproximatedDiameter()
Computues a two-sweeps approximation of the diameter of this graph.
|
static toools.Version |
getVersion()
Computes the version of the Grph library installed.
|
NumericalProperty |
getVertexColorProperty() |
int |
getVertexDegree(int v) |
int |
getVertexDegree(int v,
Grph.TYPE type,
Grph.DIRECTION dir)
Computes different types of degrees of the given vertex.
|
Property |
getVertexLabelProperty() |
NumericalProperty |
getVertexShapeProperty() |
NumericalProperty |
getVertexSizeProperty() |
it.unimi.dsi.fastutil.ints.IntSet |
getVerticesAccessibleThrough(int vertex,
int e) |
it.unimi.dsi.fastutil.ints.IntSet |
getVerticesAccessibleThrough(int sourceVertex,
it.unimi.dsi.fastutil.ints.IntSet links) |
toools.collections.primitive.LucIntSet |
getVerticesIncidentToEdge(int e)
Computes the set of vertices incident to the given edge.
|
it.unimi.dsi.fastutil.ints.IntSet |
getVerticesOfDegree(int degree)
Returns the subset of vertices that have a degree equal to
degree . |
it.unimi.dsi.fastutil.ints.IntSet |
getVerticesOfDegree(int degree,
Grph.DIRECTION dir)
Returns the subset of vertices that have a in-degree or out-degree equal
to
degree , depending on the dir parameter's
value. |
it.unimi.dsi.fastutil.ints.IntSet |
getVerticesOfDegreeAtLeast(int minDegree)
Returns the subset of vertices that have a degree at least
degree . |
void |
glp()
Computes a GLP topology from the vertices in the graph.
|
void |
grid(int width,
int height)
Connect vertices currently in the graph as a grid of dimension (w, h).
|
void |
grid(int width,
int height,
boolean directed,
boolean createDiagonal,
boolean secondaryDiagonal)
Connect vertices currently in the graph as a grid of dimension (w, h).
|
boolean |
hasCycles(int src)
Checks if this graph has a cycle, by initiating the search from the given
source.
|
boolean |
hasLoop(int v)
Checks if the given vertex has self-loops on it.
|
boolean |
hasLoops() |
boolean |
hasMultipleEdges()
Checks if this graph is has multiple edges in it.
|
void |
highlight(java.util.Collection<Cluster> clusters) |
void |
highlight(java.util.Collection<Cluster> clusters,
boolean highlightClusterHeads) |
void |
highlight(Grph subgraph)
Assigns the given color to all vertices and edges in the given graph.
|
void |
highlight(Grph subgraph,
int color) |
void |
highlightEdges(it.unimi.dsi.fastutil.ints.IntSet edges) |
void |
highlightEdges(it.unimi.dsi.fastutil.ints.IntSet edges,
int color)
Assigns the given color to all edges in the given set.
|
void |
highlightVertex(int v,
int color) |
void |
highlightVertices(java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> sets) |
void |
highlightVertices(int... vertices) |
void |
highlightVertices(it.unimi.dsi.fastutil.ints.IntSet vertices)
Assign adequate color to the given vertices so that they distinguish
clearly on graphical views of this graph.
|
void |
highlightVertices(it.unimi.dsi.fastutil.ints.IntSet vertices,
int color)
Assigns the given color to all vertices in the given set.
|
boolean |
isAntigraph()
Checks whether this graph is an antigraph.
|
boolean |
isBipartite()
Checks if this graph is bipartite.
|
boolean |
isChordal()
Checks if this graph is chordal or not.
|
boolean |
isClique(it.unimi.dsi.fastutil.ints.IntSet s)
Checks if the given set of vertices describes a clique in this graph.
|
boolean |
isComplete()
Checks if this graph is a complete graph.
|
boolean |
isConnected()
Checks if this graph is made of one single partition
|
boolean |
isCut(it.unimi.dsi.fastutil.ints.IntSet... setsOfVertices)
Computes if the given sets form a cut of this graph.
|
boolean |
isCut(it.unimi.dsi.fastutil.ints.IntSet a,
it.unimi.dsi.fastutil.ints.IntSet b)
Computes if the two given sets form a cut of this graph.
|
boolean |
isCyclic()
Checks whether this graph is cyclic or not (o circuit in the case of
digraphs).
|
boolean |
isDirected()
Checks if this graph is directed or not (i.e.
|
boolean |
isDirectedSimpleEdge(int u,
int v) |
boolean |
isDirectedSimpleGraph()
Checks if this graph has only directed simple edges.
|
boolean |
isDominatingSet(it.unimi.dsi.fastutil.ints.IntSet s)
Tests if the given set in a dominating set of this graph.
|
boolean |
isHyperEdge(int e) |
boolean |
isHypergraph()
Checks if this graph is an hypergraph or not (i.e.
|
boolean |
isIndependentSet(it.unimi.dsi.fastutil.ints.IntSet s)
Tests if the given set is an independent set (a.k.a.
|
boolean |
isIrreflexive()
Checks if this graph is an irreflexive graph
|
boolean |
isIsomorphicTo(Grph anotherGraph)
Returns true if this graph is isomorphic to the given graph, false
otherwise.
|
boolean |
isLeaf(int v)
Checks if the given vertex is a leaf.
|
boolean |
isLoop(int edge)
Checks whether the given edge is a self-loop or not.
|
boolean |
isMatching(it.unimi.dsi.fastutil.ints.IntSet s)
Computes if the given set of edges forms a matching of this graph.
|
boolean |
isMixed()
Checks if this graph is mixed or not (i.e.
|
boolean |
isNull()
Checks if this graph is a null graph.
|
boolean |
isReflexive()
Checks if this graph is a reflexive graph.
|
boolean |
isRegular()
Checks if this graph is a regular graph.
|
boolean |
isSimple()
Checks if this graph is a simple graph
|
boolean |
isSimpleEdge(int edge)
Checks if the given edge is a simple edge.
|
boolean |
isSimplicial(int v)
Checks if the given vertex is a simplicial one.
|
boolean |
isSink(int v)
Checks if the given vertex is a sink.
|
boolean |
isSource(int v)
Checks if the given vertex is a source.
|
boolean |
isStronglyConnected() |
boolean |
isTree()
Checks if this graph is a tree.
|
boolean |
isTrivial()
Checks if this graph is a trivial graph.
|
boolean |
isUndirectedSimpleEdge(int u,
int v) |
boolean |
isUndirectedSimpleGraph()
Checks if this graph has only undirected simple edges.
|
boolean |
isVertexCover(it.unimi.dsi.fastutil.ints.IntSet s)
Tests if the given set in a vertex cover of this graph.
|
java.util.Collection<GrphAlgorithmCache> |
listCachingGraphAlgorithms()
Lists all graph algorithms that employ a cache.
|
static Grph |
loadOnlineGrph(java.lang.String url)
Loads the graph from the given URL.
|
static void |
main(java.lang.String[] args) |
void |
merge(Grph otherGraph) |
void |
performRandomTopologicalChange(java.util.Random r)
Performs a random change in this graph.
|
java.lang.String |
postOnTheWeb()
Post this graph this Grph website.
|
it.unimi.dsi.fastutil.ints.IntSet |
prune(boolean recursive)
Prunes this graph (remove leaves)
|
void |
removeEdges(it.unimi.dsi.fastutil.ints.IntSet edges)
Removes the given vertices from the graph.
|
void |
removeVertices(int... vertices)
Removes the given vertices from the graph.
|
it.unimi.dsi.fastutil.ints.IntSet |
removeVertices(java.util.function.IntPredicate filter,
boolean recursive)
Removes all vertices matching the given filter.
|
void |
removeVertices(it.unimi.dsi.fastutil.ints.IntSet s)
Deletes the given vertices from the graph.
|
toools.io.file.RegularFile |
report()
Computes a report for this graph.
|
void |
revertEdge(int e) |
void |
ring()
Creates an undirected ring consisting of the vertices already in the
graph.
|
void |
ring(boolean directed) |
void |
ring(it.unimi.dsi.fastutil.ints.IntSet vertices,
boolean directed) |
void |
rnws(int k,
double p)
Connects the vertices in the graph according to the
Random-Newman-Watts-Strogatz topology generation scheme.
|
void |
rnws(int numberOfVertices,
int k,
double p) |
SearchResult |
search(int v,
NumericalProperty edgeWeights) |
void |
setEdgesColor(NumericalProperty edgesColor) |
void |
setEdgesLabel(Property edgesLabel) |
void |
setEdgesStyle(NumericalProperty edgesStyle) |
void |
setEdgesWidth(NumericalProperty edgesWidth) |
void |
setVerticesColor(NumericalProperty verticesColor) |
void |
setVerticesLabel(Property verticesLabel) |
void |
setVerticesShape(NumericalProperty verticesShape) |
void |
setVerticesSize(NumericalProperty verticesSize) |
it.unimi.dsi.fastutil.ints.IntArrayList |
sortTopologically()
Topological sort of the vertices in this graph.
|
int[] |
sortVerticesByDegree()
Sort all vertices by degree.
|
AbstractStepper |
stepMonitor() |
java.lang.String |
toDot()
Computes a GraphViz expression of this graph.
|
java.lang.String |
toEdgeList() |
java.lang.String |
toGraphML()
Computes a GraphML (XML) expression of this graph.
|
GraphstreamBasedRenderer |
toGraphStream_0_4_2_AWTComponent() |
toools.io.file.RegularFile |
toGraphviz(GraphvizImageWriter.COMMAND cmd,
GraphvizImageWriter.OUTPUT_FORMAT outputFormat) |
toools.io.file.RegularFile |
toGraphviz(GraphvizImageWriter.COMMAND cmd,
GraphvizImageWriter.OUTPUT_FORMAT outputFormat,
toools.io.file.Directory destination)
Computes a graphic file containing a representation of this graph
generated by GraphViz.
|
byte[] |
toGrphBinary()
Computes a native-Grph binary expression of this graph.
|
java.lang.String |
toGrphText()
Computes a native-Grph textual expression of this graph.
|
java.lang.String |
toString_elements() |
java.lang.String |
toString() |
java.lang.String |
toTextADJ() |
Grph |
toUndirectedGraph() |
void |
undirectionalizeEdge(int e) |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addUndirectedSimpleEdge, getNumberOfUndirectedSimpleEdges, getOneVertex, getTheOtherVertex, isUndirectedSimpleEdge
addDirectedSimpleEdge, getDirectedSimpleEdgeHead, getDirectedSimpleEdgeTail, getNumberOfDirectedSimpleEdges, isDirectedSimpleEdge
addToUndirectedHyperEdge, addUndirectedHyperEdge, getNumberOfUndirectedHyperEdges, getUndirectedHyperEdgeVertices, isUndirectedHyperEdge, removeFromHyperEdge
addDirectedHyperEdge, addToDirectedHyperEdgeHead, addToDirectedHyperEdgeTail, getDirectedHyperEdgeHead, getDirectedHyperEdgeTail, getNumberOfDirectedHyperEdges, isDirectedHyperEdge, removeFromDirectedHyperEdgeHead, removeFromDirectedHyperEdgeTail
getInOnlyElements, getInOutOnlyElements, getNavigation, getOutOnlyElements
removeEdge
addVertex, containsVertex, getNextVertexAvailable, getVertices, removeVertex
containsEdge, getEdges, getNextEdgeAvailable, removeEdge, storeEdges
public static toools.io.file.Directory COMPILATION_DIRECTORY
public static toools.log.Logger logger
public static boolean useCache
public static final java.util.Set<java.lang.String> HOSTS
public final transient GrphAlgorithm<java.lang.Integer> centerAlgorithm
public final transient AllClusteringCoefficientsAlgorithm allClusteringCoefficientsAlgorithm
public final transient GrphAlgorithm<java.lang.Double> avgClusteringCoefficientAlgorithm
public final transient GrphAlgorithm<DistanceMatrix> unweightedDistanceMatrixAlgorithm
public final transient GrphAlgorithm<PredecessorMatrix> unweightedPredecessorMatrixAlgorithm
public final transient GrphAlgorithmCache<java.lang.Double> densityAlgorithm
public final transient GrphAlgorithmCache<java.lang.Double> avgDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> diameterAlgorithm
public final transient GrphAlgorithm<SearchResult[]> bfsAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> radiusAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> maxInEdgeDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> maxInVertexDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> maxOutEdgeDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> maxOutVertexDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> minInEdgeDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> minInVertexDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> minOutEdgeDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> minOutVertexDegreeAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> completenessAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> connectednessAlgorithm
public final transient GrphAlgorithmCache<MultigraphnessResult> multigraphnessAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> reflexivityAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> regularityAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> simplenessAlgorithm
public final transient GrphAlgorithmCache<java.lang.Boolean> treenessAlgorithm
public final transient GrphAlgorithmCache<int[]> vertexListAlgorithm
public final transient GrphAlgorithmCache<Grph> complementAlgorithm
public final transient GrphAlgorithmCache<int[][]> outNeighborsAlgorithm
public final transient GrphAlgorithmCache<int[][]> inNeighborsAlgorithm
public final transient GrphAlgorithmCache<int[][]> inOutNeighborsAlgorithm
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntSet[]> vertexAdjacenciesAsIDSetsAlgorithm
public final transient GrphAlgorithmCache<Grph> lineGraphAlg
public final transient GrphAlgorithmCache<Result> trianglesAlgorithm
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntSet> isolatedVerticesAlgorithm
public final transient GrphAlgorithmCache<AdjacencyMatrix> adjacencyMatrixAlgo
public final transient GrphAlgorithmCache<toools.math.IntMatrix> incidenceMatrixAlgo
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntSet> inacessibleVertices
public final transient GrphAlgorithmCache<java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet>> connectedComponentsAlg
public final transient GrphAlgorithmCache<java.lang.Boolean> irreflexiveAlgorithm
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntArrayList> topologicalSortingAlg
public final transient GrphAlgorithmCache<java.lang.Boolean> isCyclicAlgorithm
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntSet> girthAlgorithm
public final transient GrphAlgorithmCache<java.lang.Integer> twoSweepDiameterAlg
public final transient GrphAlgorithmCache<GraphColoring> bipartiteAlgorithm
public final transient GrphAlgorithmCache<it.unimi.dsi.fastutil.ints.IntSet> LPMaxMatchingAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> LPMinVertexCoverAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> bruteForceMinimumVertexCoverAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> branchingMinimumVertexCoverAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> NiedermeierMinimumVertexCoverAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> LPMaximumindependentSetAlgorithm
public final transient GrphAlgorithm<it.unimi.dsi.fastutil.ints.IntSet> FominGrandoniKratschMaximumindependentSetAlgorithm
public final GrphAlgorithm<java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet>> tarjanSCC
public final GrphAlgorithmCache<java.lang.Boolean> chordalAlgo
public boolean isHypergraph()
public java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> getStronglyConnectedComponents()
public boolean isStronglyConnected()
public boolean isMixed()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Collection<Property> getProperties()
public static Grph fromGrphText(java.lang.String text) throws ParseException, GraphBuildException
ParseException
GraphBuildException
public static Grph fromGrphBinary(byte[] text) throws ParseException, GraphBuildException
ParseException
GraphBuildException
public static Grph fromGrphTextFile(java.lang.String filename) throws ParseException, org.xml.sax.SAXException, GraphBuildException, java.io.IOException
ParseException
org.xml.sax.SAXException
GraphBuildException
java.io.IOException
public static Grph fromGraphML(java.lang.String graphMLText) throws ParseException, org.xml.sax.SAXException
ParseException
org.xml.sax.SAXException
public static Grph fromGraphML(java.lang.String graphMLText, java.lang.Class vPropertyClass, java.lang.Class ePropertyClass) throws ParseException, org.xml.sax.SAXException
ParseException
org.xml.sax.SAXException
public static Grph loadOnlineGrph(java.lang.String url) throws ParseException, GraphBuildException, java.io.IOException
the
- URL where the graph data will be read from.ParseException
GraphBuildException
java.io.IOException
public void clearCache()
public PageRank getPageRanking(java.util.Random r)
public java.lang.String postOnTheWeb() throws java.io.IOException
java.io.IOException
public Grph getSpanningTree()
public Grph getComplement()
public it.unimi.dsi.fastutil.ints.IntArrayList getAllOutEdgeDegrees()
public Grph getLineGraph()
public Grph getLineGraph(int n)
n
- the number of iterations to performpublic boolean isUndirectedSimpleGraph()
public boolean isDirectedSimpleGraph()
public boolean areVerticesAdjacent(int src, int dest)
src
- a vertexdest
- another vertexpublic it.unimi.dsi.fastutil.ints.IntSet getEdgesAdjacentToEdge(int e)
e
- an edgepublic int getSomeEdgeConnecting(int src, int dest)
src
- dest
- public double[] getLocalClusteringCoefficients()
public double getAverageClusteringCoefficient()
public double getClusteringCoefficient(int v)
public double getClusteringCoefficient()
public toools.math.Distribution<java.lang.Double> getClusteringCoefficientDistribution()
public it.unimi.dsi.fastutil.ints.IntSet getVerticesOfDegree(int degree)
degree
. For directed graphs, no distinction is made between
in-edges and out-edges. To specify this, see
getVerticesOfDegree(int, DIRECTION)
degree
- public it.unimi.dsi.fastutil.ints.IntSet getVerticesOfDegreeAtLeast(int minDegree)
degree
. Designed only for simple, undirected graphsminDegree
- public it.unimi.dsi.fastutil.ints.IntSet getVerticesOfDegree(int degree, Grph.DIRECTION dir)
degree
, depending on the dir
parameter's
value.degree
- public boolean contains(Grph g)
g
- public Grph getBipartiteSubgraphInducedByVertices(it.unimi.dsi.fastutil.ints.IntSet A, it.unimi.dsi.fastutil.ints.IntSet B)
A
- a set of verticesB
- a set of verticespublic Grph getSubgraphInducedByVertices(it.unimi.dsi.fastutil.ints.IntSet vertices)
vertices
- public Grph getSubgraphInducedByEdges(it.unimi.dsi.fastutil.ints.IntSet edges)
edges
- public void highlightVertices(it.unimi.dsi.fastutil.ints.IntSet vertices, int color)
vertices
- the set of vertices for which the color will be setcolor
- the color to assign to verticespublic void highlightVertices(int... vertices)
public void highlightEdges(it.unimi.dsi.fastutil.ints.IntSet edges, int color)
edges
- the set of edges for which the color will be setcolor
- the color to assign to edgespublic void highlight(Grph subgraph)
subgraph
- the graph that must be selectedcolor
- the color to assign to the graphpublic void highlight(Grph subgraph, int color)
public it.unimi.dsi.fastutil.ints.IntSet getShortestCycle()
public int getGirth()
public boolean isIsomorphicTo(Grph anotherGraph)
public java.util.Collection<Matching> getPartialSubgraphIsomorphism(Grph pattern, boolean findAllSolutions)
public java.util.List<Matching> getInducedSubgraphIsomorphism(Grph pattern, boolean findAllSolutions)
public boolean isDominatingSet(it.unimi.dsi.fastutil.ints.IntSet s)
s
- public boolean isIndependentSet(it.unimi.dsi.fastutil.ints.IntSet s)
s
- public boolean isMatching(it.unimi.dsi.fastutil.ints.IntSet s)
s
- public boolean isVertexCover(it.unimi.dsi.fastutil.ints.IntSet s)
s
- public it.unimi.dsi.fastutil.ints.IntSet getMaximumMatching()
public it.unimi.dsi.fastutil.ints.IntSet getMinimumVertexCover()
public it.unimi.dsi.fastutil.ints.IntSet getMinimumVertexCover(Grph.MinVertexCoverAlgorithm algorithm)
public it.unimi.dsi.fastutil.ints.IntSet getMaximumIndependentSet()
public it.unimi.dsi.fastutil.ints.IntSet getMaximumIndependentSet(Grph.MaxIndependentSetAlgorithm algorithm)
public int getNumberOfTriangles()
public final java.util.Collection<GrphAlgorithmCache> listCachingGraphAlgorithms()
public GrphAlgorithm findAlgorithm(java.lang.String name)
public void connectToKClosestNeighbors(int k)
k
- the number of neighbours to connect to.public void grid(int width, int height)
width
- height
- public void dgrid(int width, int height)
width
- height
- public void grid(int width, int height, boolean directed, boolean createDiagonal, boolean secondaryDiagonal)
width
- height
- directed
- indicated whether created edges should be directed or notcreateDiagonal
- indicates whether diagonals edges should be created or notpublic final int addSimpleEdge(int src, int dest, boolean directed)
src
- a vertexdest
- another vertexdirected
- whether edges are directed or notpublic final void addSimpleEdge(int src, int edge, int dest, boolean directed)
src
- a vertexdest
- another vertexedge
- the edge that will connect the two verticesdirected
- whether edges are directed or notpublic boolean isCut(it.unimi.dsi.fastutil.ints.IntSet a, it.unimi.dsi.fastutil.ints.IntSet b)
a
- a set of verticesb
- another set of verticespublic boolean isCut(it.unimi.dsi.fastutil.ints.IntSet... setsOfVertices)
setsOfVertices
- sets of verticespublic void rnws(int k, double p)
k
- the distance of the neighbours to which each vertex is
attachedp
- the probability to create a shortcut for any pairpublic void rnws(int numberOfVertices, int k, double p)
public it.unimi.dsi.fastutil.ints.IntSet getCutEdges(it.unimi.dsi.fastutil.ints.IntSet a, it.unimi.dsi.fastutil.ints.IntSet b)
a
- a set of verticesb
- another set of verticespublic int getCutSize(it.unimi.dsi.fastutil.ints.IntSet a, it.unimi.dsi.fastutil.ints.IntSet b)
a
- a set of verticesb
- another set of verticespublic final void disconnect(int src, int destination)
src
- a vertexdestination
- another vertexpublic void ring(boolean directed)
public void ring(it.unimi.dsi.fastutil.ints.IntSet vertices, boolean directed)
public void dring()
public void ring()
public void removeVertices(int... vertices)
vertices
- the vertices to be removedpublic void removeEdges(it.unimi.dsi.fastutil.ints.IntSet edges)
vertices
- the set of vertices to be removedpublic int getEccentricity(int v, NumericalProperty weights)
v
- public int getEccentricity(int v)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
backingGrph
- public boolean equals(Grph g)
g
- public final java.lang.String getDifference(Grph g)
g
- public grph.Grph.EDGE_NATURE getEdgeNature(int e)
e
- public void undirectionalizeEdge(int e)
public void revertEdge(int e)
public it.unimi.dsi.fastutil.ints.IntSet getEdgesIncidentTo(int v)
thisVertex
- a vertexpublic void clear()
public toools.collections.primitive.LucIntSet getOutEdges(int v)
v
- a vertexpublic toools.collections.primitive.LucIntSet getInEdges(int v)
v
- a vertexpublic toools.collections.primitive.LucIntSet getOutNeighbors(int v)
v
- public toools.collections.primitive.LucIntSet getOutOnlyEdges(int v)
public toools.collections.primitive.LucIntSet getInOnlyEdges(int v)
public toools.collections.primitive.LucIntSet getInOutOnlyEdges(int v)
public int addUndirectedSimpleEdge(int v1, int v2)
v1
- a vertexv2
- another vertexpublic int addVertex()
protected it.unimi.dsi.fastutil.ints.IntSet getInElements(int v)
public boolean isSimpleEdge(int edge)
edge
- an edgepublic boolean isHyperEdge(int e)
public void disconnectVertex(int v)
v
- the vertex to be isolatedpublic it.unimi.dsi.fastutil.ints.IntSet getInNeighbours(int v)
public toools.collections.primitive.LucIntSet getVerticesIncidentToEdge(int e)
thisEdge
- public static void main(java.lang.String[] args)
public final Grph clone()
clone
in class java.lang.Object
public Property findPropertyByName(java.lang.String name)
public java.util.List<TopologyListener> getTopologyListeners()
public boolean isDirected()
public java.lang.String toGrphText()
public java.lang.String toEdgeList()
public java.lang.String toTextADJ()
public byte[] toGrphBinary()
public java.lang.String toGraphML()
public java.lang.String toDot()
public int getDiameter()
public MaxFlowAlgorithmResult computeMaxFlow(int s, int t, NumericalProperty weights)
s
- a source vertext
- a destination vertexpublic double getDensity()
public int getRadius()
public boolean isNull()
public boolean isTrivial()
public int getMaxInEdgeDegrees()
public int getMaxOutEdgeDegrees()
public int getMinInEdgeDegrees()
public int getMinOutEdgeDegrees()
public int getMaxInVertexDegrees()
public int getMaxOutVertexDegrees()
public int getMinInVertexDegrees()
public int getMinOutVertexDegrees()
public boolean isComplete()
public boolean isConnected()
public boolean isReflexive()
public boolean isRegular()
public java.util.Collection<VertexPair> getEdgePairs()
public int getNumberOfHyperEdges()
public int getNumberOfSimpleEdges()
public int getNumberOfDirectedEdges()
public int getNumberOfUndirectedEdges()
public boolean hasMultipleEdges()
public boolean isTree()
public static toools.Version getVersion()
public void displayReport() throws java.io.IOException
java.io.IOException
public void display()
public void displaySVGSalamander()
public javax.swing.JComponent createSwingRenderer()
public void performRandomTopologicalChange(java.util.Random r)
r
- public int addDirectedSimpleEdge(int tail, int head)
tail
- the source of the archead
- the destination of the arcpublic it.unimi.dsi.fastutil.ints.IntSet getIsolatedVertices()
public int getOrder()
public int getNumberOfVertices()
public toools.collections.primitive.LucIntSet getNeighbours(int v)
v
- a vertexpublic it.unimi.dsi.fastutil.ints.IntSet getNeighbours(it.unimi.dsi.fastutil.ints.IntSet s)
s
- a set of verticespublic int getVertexDegree(int v, Grph.TYPE type, Grph.DIRECTION dir)
v
- a vertextype
- the type of degree (edge or vertex)dir
- the direction of the degree (in or out)public int getEdgeDegree(int v)
public int getVertexDegree(int v)
public java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> getGpmetisPartitionning(int numberOfPartitions, java.util.Random r)
public java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> getGpmetisPartitionning(int numberOfPartitions, Gpmetis.Ptype ptype, Gpmetis.Ctype ctype, Gpmetis.Iptype iptype, Gpmetis.Objtype objtype, boolean contig, boolean minconn, int ufactor, int niter, int ncuts, java.util.Random r)
public int getInEdgeDegree(int v)
public int getInVertexDegree(int v)
public int getOutEdgeDegree(int v)
public int getOutVertexDegree(int v)
public it.unimi.dsi.fastutil.ints.IntSet getEdgesConnecting(int src, int dest)
public void addHyperEdge(int edge, int... vertices)
public toools.collections.primitive.LucIntSet getInNeighbors(int v)
public toools.collections.primitive.LucIntSet getNeighbours(int vertex, Grph.DIRECTION direction)
public it.unimi.dsi.fastutil.ints.IntSet getKClosestNeighbors(int vertex, int k, NumericalProperty edgeWeights)
public it.unimi.dsi.fastutil.ints.IntSet getNeighborsAtMaxDistance(int vertex, int maxDistance, NumericalProperty p)
public it.unimi.dsi.fastutil.ints.IntSet getNeighboursAtMostKHops(int k, int v)
public java.util.List<it.unimi.dsi.fastutil.ints.IntSet> getFringes(int numberOfHops, int root)
public it.unimi.dsi.fastutil.ints.IntSet getLoops(int v)
v
- any vertex belonging to the graphpublic boolean isLoop(int edge)
public boolean hasLoop(int v)
v
- a vertexpublic it.unimi.dsi.fastutil.ints.IntSet getInaccessibleVertices()
graph
- public java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> getConnectedComponents()
public void chain(boolean directed)
directed
- whether edges should be directed or notpublic it.unimi.dsi.fastutil.ints.IntSet getConnectedComponentContaining(int vertex, Grph.DIRECTION direction)
vertex
- a vertexdirection
- a direction (in, out or in_out)public boolean isSimple()
public boolean isIrreflexive()
public toools.math.Distribution<java.lang.Integer> getDegreeDistribution(Grph.TYPE type, Grph.DIRECTION dir)
type
- the type of the distribution (edge or vertex)dir
- the direction (in, out or in_out)public boolean isSimplicial(int v)
v
- a vertexpublic it.unimi.dsi.fastutil.ints.IntSet prune(boolean recursive)
recursive
- if pruning should continue while there are still leaves in
this graphpublic it.unimi.dsi.fastutil.ints.IntSet removeVertices(java.util.function.IntPredicate filter, boolean recursive)
filter
- a vertex filterrecursive
- public boolean isClique(it.unimi.dsi.fastutil.ints.IntSet s)
s
- a set of verticespublic boolean hasCycles(int src)
src
- a vertexpublic it.unimi.dsi.fastutil.ints.IntArrayList sortTopologically()
public it.unimi.dsi.fastutil.ints.IntArrayList getAllInEdgeDegrees()
public it.unimi.dsi.fastutil.ints.IntSet addNVertices(int n)
n
- the number of vertices to be created.public boolean isCyclic()
public void glp()
public double getAverageDegree()
public double getAverageDegree(Grph.TYPE type, Grph.DIRECTION direction)
type
- the type of degree (edge or vertex)direction
- the direction (in, out, in_out)public SearchResultWrappedPath getShortestPath(int source, int destination, NumericalProperty edgeWeights)
source
- a vertexdestination
- another vertexpublic Path getShortestPath(int source, int destination)
public SearchResult bfs(int source)
source
- a vertex to start the BFS from.public SearchResult[] bfs(toools.collections.primitive.LucIntSet sources)
public boolean containsAPath(int source, int destination)
public int[][] getOutNeighborhoods()
public int[][] getInNeighborhoods()
public int[][] getNeighborhoods()
public int[][] getNeighbors(Grph.DIRECTION direction)
public int getTwoSweepBFSDiameterApproximatedDiameter()
public void clique()
public boolean isAntigraph()
public java.util.Collection<Path> getAllPaths()
public java.util.Set<Path> getAllCycles()
public DistanceMatrix getDistanceMatrix(NumericalProperty edgeWeights)
public AdjacencyMatrix getAdjacencyMatrix()
public toools.math.IntMatrix getIncidenceMatrix()
public void removeVertices(it.unimi.dsi.fastutil.ints.IntSet s)
s
- the set of vertices to be removed from the graph.public void addVertices(it.unimi.dsi.fastutil.ints.IntSet s)
public int[] sortVerticesByDegree()
public toools.io.file.RegularFile toGraphviz(GraphvizImageWriter.COMMAND cmd, GraphvizImageWriter.OUTPUT_FORMAT outputFormat, toools.io.file.Directory destination) throws java.io.IOException
cmd
- the command to use (dot, neato, etc)outputFormat
- the format for the graphic data (PNG, PDF, etc)destination
- the directory where the graphic file will be written tojava.io.IOException
public toools.io.file.RegularFile toGraphviz(GraphvizImageWriter.COMMAND cmd, GraphvizImageWriter.OUTPUT_FORMAT outputFormat)
public boolean isSource(int v)
v
- a vertex in the graphpublic boolean isSink(int v)
v
- a vertex in the graphpublic boolean isLeaf(int v)
v
- a vertex in the graphpublic it.unimi.dsi.fastutil.ints.IntSet getLargestConnectedComponent()
public java.lang.String getDescription()
public void ensureNVertices(int n)
n
- the minimum number of vertices required for this graph.public it.unimi.dsi.fastutil.ints.IntSet getMaximumClique()
public boolean isChordal()
public it.unimi.dsi.fastutil.ints.IntSet getSimplicialVertices()
public void highlightVertices(it.unimi.dsi.fastutil.ints.IntSet vertices)
vertices
- a set of vertices to be colored (selected)public void highlightEdges(it.unimi.dsi.fastutil.ints.IntSet edges)
public toools.io.file.RegularFile report() throws java.io.IOException
java.io.IOException
public it.unimi.dsi.fastutil.ints.IntSet getSources()
public it.unimi.dsi.fastutil.ints.IntSet getSinks()
public int getNumberOfEdges()
public int getSize()
public boolean isBipartite()
public void clique(it.unimi.dsi.fastutil.ints.IntSet s)
s
- a set of vertices in the graphpublic void highlightVertices(java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> sets)
public it.unimi.dsi.fastutil.ints.IntArrayList bfsList(int sourceVertex)
public AbstractStepper stepMonitor()
public void highlight(java.util.Collection<Cluster> clusters)
public void highlight(java.util.Collection<Cluster> clusters, boolean highlightClusterHeads)
public void highlightVertex(int v, int color)
public void displayImg()
public int getCenter()
public it.unimi.dsi.fastutil.ints.IntSet getVerticesAccessibleThrough(int vertex, int e)
public it.unimi.dsi.fastutil.ints.IntSet getVerticesAccessibleThrough(int sourceVertex, it.unimi.dsi.fastutil.ints.IntSet links)
public boolean hasLoops()
public it.unimi.dsi.fastutil.ints.Int2IntMap addGraph(Grph otherGraph)
public void merge(Grph otherGraph)
public void contractVertices(int a, int b)
a
- b
- allowMultipleEdges
- public void contractVertices(int a, int b, boolean allowMultipleEdges)
public static Grph fromCaidaMap(toools.io.file.RegularFile f) throws java.io.IOException, GraphBuildException, ParseException
filename
- ParseException
java.io.IOException
GraphBuildException
public void contractEdge(int e)
public boolean areEdgesAdjacent(int a, int b)
public static int getDefaultNumberOfThreads()
public java.util.List<ArrayListPath> getKShortestPaths(int s, int t, int k, NumericalProperty edgeWeights)
public java.util.Collection<it.unimi.dsi.fastutil.ints.IntSet> getCliques()
public void getCircleStar()
public Grph toUndirectedGraph()
public java.lang.String toString_elements()
public Property getVertexLabelProperty()
public void setVerticesLabel(Property verticesLabel)
public Property getEdgeLabelProperty()
public void setEdgesLabel(Property edgesLabel)
public NumericalProperty getVertexColorProperty()
public void setVerticesColor(NumericalProperty verticesColor)
public NumericalProperty getEdgeColorProperty()
public void setEdgesColor(NumericalProperty edgesColor)
public NumericalProperty getEdgeWidthProperty()
public void setEdgesWidth(NumericalProperty edgesWidth)
public NumericalProperty getVertexSizeProperty()
public void setVerticesSize(NumericalProperty verticesSize)
public NumericalProperty getVertexShapeProperty()
public void setVerticesShape(NumericalProperty verticesShape)
public NumericalProperty getEdgeStyleProperty()
public void setEdgesStyle(NumericalProperty edgesStyle)
public boolean isUndirectedSimpleEdge(int u, int v)
public boolean isDirectedSimpleEdge(int u, int v)
public toools.collections.primitive.LucIntSet getOppositeEdges(int e)
public SearchResult search(int v, NumericalProperty edgeWeights)
public int getFartestVertex(int v)
public int getFartestVertex(int v, NumericalProperty edgeWeights)
public org.miv.graphstream.ui.GraphViewerRemote displayGraphstream_0_4_2()
public GraphstreamBasedRenderer toGraphStream_0_4_2_AWTComponent()