public class InMemoryGrph extends Grph implements java.io.Serializable
Grph.DIRECTION, Grph.MaxIndependentSetAlgorithm, Grph.MinVertexCoverAlgorithm, Grph.TYPE
adjacencyMatrixAlgo, allClusteringCoefficientsAlgorithm, avgClusteringCoefficientAlgorithm, avgDegreeAlgorithm, bfsAlgorithm, bipartiteAlgorithm, branchingMinimumVertexCoverAlgorithm, bruteForceMinimumVertexCoverAlgorithm, centerAlgorithm, chordalAlgo, COMPILATION_DIRECTORY, complementAlgorithm, completenessAlgorithm, connectedComponentsAlg, connectednessAlgorithm, densityAlgorithm, diameterAlgorithm, FominGrandoniKratschMaximumindependentSetAlgorithm, girthAlgorithm, HOSTS, inacessibleVertices, incidenceMatrixAlgo, inNeighborsAlgorithm, inOutNeighborsAlgorithm, irreflexiveAlgorithm, isCyclicAlgorithm, isolatedVerticesAlgorithm, lineGraphAlg, logger, LPMaximumindependentSetAlgorithm, LPMaxMatchingAlgorithm, LPMinVertexCoverAlgorithm, maxInEdgeDegreeAlgorithm, maxInVertexDegreeAlgorithm, maxOutEdgeDegreeAlgorithm, maxOutVertexDegreeAlgorithm, minInEdgeDegreeAlgorithm, minInVertexDegreeAlgorithm, minOutEdgeDegreeAlgorithm, minOutVertexDegreeAlgorithm, multigraphnessAlgorithm, NiedermeierMinimumVertexCoverAlgorithm, outNeighborsAlgorithm, radiusAlgorithm, reflexivityAlgorithm, regularityAlgorithm, simplenessAlgorithm, tarjanSCC, topologicalSortingAlg, treenessAlgorithm, trianglesAlgorithm, twoSweepDiameterAlg, unweightedDistanceMatrixAlgorithm, unweightedPredecessorMatrixAlgorithm, useCache, vertexAdjacenciesAsIDSetsAlgorithm, vertexListAlgorithm
Constructor and Description |
---|
InMemoryGrph() |
InMemoryGrph(java.lang.String gid,
boolean storeEdges,
Grph.DIRECTION navigation) |
InMemoryGrph(java.lang.String gid,
int expectedNbVertices,
int expectedNbEdges,
Grph.DIRECTION navigation) |
Modifier and Type | Method and Description |
---|---|
void |
addDirectedHyperEdge(int edge)
Adds the given directed hyper-edge.
|
void |
addDirectedSimpleEdge(int tail,
int edge,
int head)
Adds the given arc, connecting the given source and destination vertices.
|
void |
addToDirectedHyperEdgeHead(int e,
int v) |
void |
addToDirectedHyperEdgeTail(int e,
int v) |
void |
addToUndirectedHyperEdge(int edge,
int vertex)
Adds the given vertex to the given hyper-edge.
|
void |
addUndirectedHyperEdge(int edge)
Adds the given undirected hyper-edge to this graph.
|
void |
addUndirectedSimpleEdge(int edge,
int a,
int b)
Adds the given edge connecting the two given vertices.
|
void |
addVertex(int v) |
boolean |
containsEdge(int e) |
boolean |
containsVertex(int v) |
toools.collections.primitive.LucIntSet |
getDirectedHyperEdgeHead(int e)
Assuming the given edge is a directed hyper edge, retrieves its head.
|
toools.collections.primitive.LucIntSet |
getDirectedHyperEdgeTail(int e)
Assuming the given edge is a directed hyper edge, retrieves its tail.
|
int |
getDirectedSimpleEdgeHead(int edge)
Assuming the given edge is a directed simple edge, retrieves its head.
|
int |
getDirectedSimpleEdgeTail(int edge)
Assuming the given edge is a directed simple edge, retrieves its tail.
|
toools.collections.primitive.LucIntSet |
getEdges()
Retrieve the set of edges in this graph.
|
java.lang.String |
getID() |
toools.collections.primitive.LucIntSet |
getInOnlyElements(int v) |
toools.collections.primitive.LucIntSet |
getInOutOnlyElements(int v) |
Grph.DIRECTION |
getNavigation() |
int |
getNextEdgeAvailable() |
int |
getNextVertexAvailable() |
int |
getNumberOfDirectedHyperEdges() |
int |
getNumberOfDirectedSimpleEdges() |
int |
getNumberOfUndirectedHyperEdges() |
int |
getNumberOfUndirectedSimpleEdges() |
int |
getOneVertex(int edge)
Assuming the given edge is an undirected simple edge, retrieves one of
its incident vertices.
|
toools.collections.primitive.LucIntSet |
getOutOnlyElements(int v) |
int |
getTheOtherVertex(int edge,
int thisVertex)
Assuming the given edge is an undirected simple edge, retrieves the
incident vertex other than thisVertex.
|
toools.collections.primitive.LucIntSet |
getUndirectedHyperEdgeVertices(int edge)
Computes the set of vertices incident to the given hyper-edge.
|
toools.collections.primitive.LucIntSet |
getVertices()
Retrieve the set of vertices in this graph.
|
boolean |
isDirectedHyperEdge(int edge)
Checks whether the given edge is a directed hyper edge.
|
boolean |
isDirectedSimpleEdge(int edge)
Checks whether the given edge is a directed simple edge.
|
boolean |
isUndirectedHyperEdge(int edge)
Checks if the given edge is an undirected hyper edge.
|
boolean |
isUndirectedSimpleEdge(int edge)
Checks if the given edge is an undirected simple edge.
|
static void |
main(java.lang.String[] args) |
void |
removeEdge(int edge)
Remove the given edge from the graph.
|
void |
removeEdge(int u,
int v) |
void |
removeFromDirectedHyperEdgeHead(int edge,
int vertex) |
void |
removeFromDirectedHyperEdgeTail(int edge,
int vertex) |
void |
removeFromHyperEdge(int edge,
int vertex)
Removes the given vertex from the given hyper-edge.
|
void |
removeVertex(int v)
Removes the given vertex from the graph.
|
boolean |
storeEdges()
Checks if the two given edges have the same vertices incident to them.
|
addDirectedSimpleEdge, addGraph, addHyperEdge, addNVertices, addSimpleEdge, addSimpleEdge, addUndirectedSimpleEdge, addVertex, addVertices, areEdgesAdjacent, areVerticesAdjacent, bfs, bfs, bfsList, chain, clear, clearCache, clique, clique, clone, computeMaxFlow, connectToKClosestNeighbors, contains, containsAPath, contractEdge, contractVertices, contractVertices, createSwingRenderer, dgrid, disconnect, disconnectVertex, display, displayGraphstream_0_4_2, displayImg, displayReport, displaySVGSalamander, dring, ensureNVertices, equals, equals, findAlgorithm, findPropertyByName, fromCaidaMap, fromGraphML, fromGraphML, fromGrphBinary, fromGrphText, fromGrphTextFile, getAdjacencyMatrix, getAllCycles, getAllInEdgeDegrees, getAllOutEdgeDegrees, getAllPaths, getAverageClusteringCoefficient, getAverageDegree, getAverageDegree, getBipartiteSubgraphInducedByVertices, getCenter, getCircleStar, getCliques, getClusteringCoefficient, getClusteringCoefficient, getClusteringCoefficientDistribution, getComplement, getConnectedComponentContaining, getConnectedComponents, getCutEdges, getCutSize, getDefaultNumberOfThreads, getDegreeDistribution, getDensity, getDescription, getDiameter, getDifference, getDistanceMatrix, getEccentricity, getEccentricity, getEdgeColorProperty, getEdgeDegree, getEdgeLabelProperty, getEdgeNature, getEdgePairs, getEdgesAdjacentToEdge, getEdgesConnecting, getEdgesIncidentTo, getEdgeStyleProperty, getEdgeWidthProperty, getFartestVertex, getFartestVertex, getFringes, getGirth, getGpmetisPartitionning, getGpmetisPartitionning, getInaccessibleVertices, getIncidenceMatrix, getInducedSubgraphIsomorphism, getInEdgeDegree, getInEdges, getInElements, getInNeighborhoods, getInNeighbors, getInNeighbours, getInOnlyEdges, getInOutOnlyEdges, getInVertexDegree, getIsolatedVertices, getKClosestNeighbors, getKShortestPaths, getLargestConnectedComponent, getLineGraph, getLineGraph, getLocalClusteringCoefficients, getLoops, getMaximumClique, getMaximumIndependentSet, getMaximumIndependentSet, getMaximumMatching, getMaxInEdgeDegrees, getMaxInVertexDegrees, getMaxOutEdgeDegrees, getMaxOutVertexDegrees, getMinimumVertexCover, getMinimumVertexCover, getMinInEdgeDegrees, getMinInVertexDegrees, getMinOutEdgeDegrees, getMinOutVertexDegrees, getNeighborhoods, getNeighbors, getNeighborsAtMaxDistance, getNeighbours, getNeighbours, getNeighbours, getNeighboursAtMostKHops, getNumberOfDirectedEdges, getNumberOfEdges, getNumberOfHyperEdges, getNumberOfSimpleEdges, getNumberOfTriangles, getNumberOfUndirectedEdges, getNumberOfVertices, getOppositeEdges, getOrder, getOutEdgeDegree, getOutEdges, getOutNeighborhoods, getOutNeighbors, getOutOnlyEdges, getOutVertexDegree, getPageRanking, getPartialSubgraphIsomorphism, getProperties, getRadius, getShortestCycle, getShortestPath, getShortestPath, getSimplicialVertices, getSinks, getSize, getSomeEdgeConnecting, getSources, getSpanningTree, getStronglyConnectedComponents, getSubgraphInducedByEdges, getSubgraphInducedByVertices, getTopologyListeners, getTwoSweepBFSDiameterApproximatedDiameter, getVersion, getVertexColorProperty, getVertexDegree, getVertexDegree, getVertexLabelProperty, getVertexShapeProperty, getVertexSizeProperty, getVerticesAccessibleThrough, getVerticesAccessibleThrough, getVerticesIncidentToEdge, getVerticesOfDegree, getVerticesOfDegree, getVerticesOfDegreeAtLeast, glp, grid, grid, hasCycles, hasLoop, hasLoops, hasMultipleEdges, highlight, highlight, highlight, highlight, highlightEdges, highlightEdges, highlightVertex, highlightVertices, highlightVertices, highlightVertices, highlightVertices, isAntigraph, isBipartite, isChordal, isClique, isComplete, isConnected, isCut, isCut, isCyclic, isDirected, isDirectedSimpleEdge, isDirectedSimpleGraph, isDominatingSet, isHyperEdge, isHypergraph, isIndependentSet, isIrreflexive, isIsomorphicTo, isLeaf, isLoop, isMatching, isMixed, isNull, isReflexive, isRegular, isSimple, isSimpleEdge, isSimplicial, isSink, isSource, isStronglyConnected, isTree, isTrivial, isUndirectedSimpleEdge, isUndirectedSimpleGraph, isVertexCover, listCachingGraphAlgorithms, loadOnlineGrph, merge, performRandomTopologicalChange, postOnTheWeb, prune, removeEdges, removeVertices, removeVertices, removeVertices, report, revertEdge, ring, ring, ring, rnws, rnws, search, setEdgesColor, setEdgesLabel, setEdgesStyle, setEdgesWidth, setVerticesColor, setVerticesLabel, setVerticesShape, setVerticesSize, sortTopologically, sortVerticesByDegree, stepMonitor, toDot, toEdgeList, toGraphML, toGraphStream_0_4_2_AWTComponent, toGraphviz, toGraphviz, toGrphBinary, toGrphText, toString_elements, toString, toTextADJ, toUndirectedGraph, undirectionalizeEdge
public InMemoryGrph()
public InMemoryGrph(java.lang.String gid, boolean storeEdges, Grph.DIRECTION navigation)
public InMemoryGrph(java.lang.String gid, int expectedNbVertices, int expectedNbEdges, Grph.DIRECTION navigation)
public java.lang.String getID()
public boolean storeEdges()
storeEdges
in interface EdgeSet
a
- an edgeb
- another edgepublic Grph.DIRECTION getNavigation()
getNavigation
in interface DirectedGraph
public toools.collections.primitive.LucIntSet getUndirectedHyperEdgeVertices(int edge)
getUndirectedHyperEdgeVertices
in interface UndirectedHyperGraph
edge
- an hyper-edgepublic toools.collections.primitive.LucIntSet getVertices()
getVertices
in interface VertexSet
public toools.collections.primitive.LucIntSet getEdges()
public int getNextEdgeAvailable()
getNextEdgeAvailable
in interface EdgeSet
public int getNextVertexAvailable()
getNextVertexAvailable
in interface VertexSet
public toools.collections.primitive.LucIntSet getOutOnlyElements(int v)
getOutOnlyElements
in interface DirectedGraph
public toools.collections.primitive.LucIntSet getInOnlyElements(int v)
getInOnlyElements
in interface DirectedGraph
public toools.collections.primitive.LucIntSet getInOutOnlyElements(int v)
getInOutOnlyElements
in interface DirectedGraph
public static void main(java.lang.String[] args)
public void removeEdge(int u, int v)
removeEdge
in interface UnqualifiedGraph
public boolean isUndirectedSimpleEdge(int edge)
isUndirectedSimpleEdge
in interface UndirectedSimpleGraph
edge
- an edgepublic boolean isUndirectedHyperEdge(int edge)
isUndirectedHyperEdge
in interface UndirectedHyperGraph
edge
- an edgepublic void addUndirectedSimpleEdge(int edge, int a, int b)
addUndirectedSimpleEdge
in interface UndirectedSimpleGraph
a
- a vertexb
- another vertexedge
- the new edgepublic void addDirectedSimpleEdge(int tail, int edge, int head)
addDirectedSimpleEdge
in interface DirectedSimpleGraph
edge
- the arc to be addedtail
- the source of the archead
- the destination of the arcpublic void addDirectedHyperEdge(int edge)
addDirectedHyperEdge
in interface DirectedHyperGraph
edge
- the edge to be addedpublic void addUndirectedHyperEdge(int edge)
addUndirectedHyperEdge
in interface UndirectedHyperGraph
edge
- the edge to addpublic void addToUndirectedHyperEdge(int edge, int vertex)
addToUndirectedHyperEdge
in interface UndirectedHyperGraph
edge
- vertex
- public void addToDirectedHyperEdgeTail(int e, int v)
addToDirectedHyperEdgeTail
in interface DirectedHyperGraph
public void addToDirectedHyperEdgeHead(int e, int v)
addToDirectedHyperEdgeHead
in interface DirectedHyperGraph
public final void removeFromHyperEdge(int edge, int vertex)
removeFromHyperEdge
in interface UndirectedHyperGraph
edge
- an edgevertex
- a vertex incident to this edgepublic final void removeFromDirectedHyperEdgeTail(int edge, int vertex)
removeFromDirectedHyperEdgeTail
in interface DirectedHyperGraph
public final void removeFromDirectedHyperEdgeHead(int edge, int vertex)
removeFromDirectedHyperEdgeHead
in interface DirectedHyperGraph
public void removeVertex(int v)
removeVertex
in interface VertexSet
vertex
- the vertex to be removedpublic void removeEdge(int edge)
removeEdge
in interface EdgeSet
edge
- the edge to be removedpublic boolean isDirectedSimpleEdge(int edge)
isDirectedSimpleEdge
in interface DirectedSimpleGraph
edge
- an edgepublic boolean isDirectedHyperEdge(int edge)
isDirectedHyperEdge
in interface DirectedHyperGraph
edge
- an edgepublic int getDirectedSimpleEdgeTail(int edge)
getDirectedSimpleEdgeTail
in interface DirectedSimpleGraph
edge
- an edgepublic int getDirectedSimpleEdgeHead(int edge)
getDirectedSimpleEdgeHead
in interface DirectedSimpleGraph
edge
- an edgepublic int getOneVertex(int edge)
getOneVertex
in interface UndirectedSimpleGraph
edge
- an edgepublic int getTheOtherVertex(int edge, int thisVertex)
getTheOtherVertex
in interface UndirectedSimpleGraph
edge
- an edgethisVertex
- a vertex incident to edgepublic toools.collections.primitive.LucIntSet getDirectedHyperEdgeTail(int e)
getDirectedHyperEdgeTail
in interface DirectedHyperGraph
edge
- an edgepublic toools.collections.primitive.LucIntSet getDirectedHyperEdgeHead(int e)
getDirectedHyperEdgeHead
in interface DirectedHyperGraph
edge
- an edgepublic int getNumberOfUndirectedSimpleEdges()
getNumberOfUndirectedSimpleEdges
in interface UndirectedSimpleGraph
public int getNumberOfDirectedSimpleEdges()
getNumberOfDirectedSimpleEdges
in interface DirectedSimpleGraph
public int getNumberOfUndirectedHyperEdges()
getNumberOfUndirectedHyperEdges
in interface UndirectedHyperGraph
public int getNumberOfDirectedHyperEdges()
getNumberOfDirectedHyperEdges
in interface DirectedHyperGraph
public boolean containsVertex(int v)
containsVertex
in interface VertexSet
public boolean containsEdge(int e)
containsEdge
in interface EdgeSet