V
- type for verticesE
- type for edgespublic interface GraphModel<V,E extends Edge<V>>
Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(E edge)
Add an edge to this graph structure.
|
boolean |
addNode(V node)
Add a node to this graph structure
|
boolean |
containsEdge(V from,
V to) |
boolean |
containsNode(V node) |
Annotation |
getAnnotation()
Give access to the annotation associated with this graph.
|
E |
getEdge(V source,
V target) |
Collection<E> |
getEdges() |
V |
getExistingNode(V node) |
String |
getGraphName()
Give access to the name of the graph
|
Collection<E> |
getIncomingEdges(V node) |
V |
getNodeByName(String id)
Give access to the node named with the given name
|
int |
getNodeCount()
Return the number of node in this graph
|
int |
getNodeOrderSize()
Return the size of the node order
|
Collection<V> |
getNodes()
Return the Collection of the graph nodes
|
Collection<E> |
getOutgoingEdges(V node) |
List<E> |
getShortestPath(V source,
V target)
Find the shortest path between the two given vertices
|
List<Set<V>> |
getStronglyConnectedComponents()
Return a list of set of node, each set containing a strongly connected component of the graph
|
Graph<V,E> |
getSubgraph(Collection<V> node,
Collection<E> edges)
Build a graph from the provided vertices and edges based on the current graph
|
List<?> |
merge(Graph<V,E> graph)
Merge the provided graph with the current one
|
boolean |
removeEdge(E edge)
Remove an edge from the graph.
|
boolean |
removeNode(V node)
Remove a node from the graph.
|
List<V> |
searchNodes(String regexp)
Search the vertices with ID matching the given regular expression.
|
void |
setGraphName(String graphName)
changes (if success) the name associated with this graph.
|
String getGraphName()
void setGraphName(String graphName) throws GsException
graphName
- the new name.GsException
- if the name is invalid.Annotation getAnnotation()
boolean addNode(V node)
node
- boolean addEdge(E edge)
edge
- boolean removeNode(V node)
node
- boolean removeEdge(E edge)
edge
- int getNodeCount()
Collection<V> getNodes()
V getNodeByName(String id)
id
- name of a nodeint getNodeOrderSize()
List<V> searchNodes(String regexp)
regexp
- the regular expression node ID must match to be selectedE getEdge(V source, V target)
source
- target
- Collection<E> getEdges()
boolean containsNode(V node)
node
- boolean containsEdge(V from, V to)
from
- to
- Collection<E> getIncomingEdges(V node)
node
- Collection<E> getOutgoingEdges(V node)
node
- List<E> getShortestPath(V source, V target)
source
- the node at the beginning of the searched pathtarget
- the node at the end of the searched pathList<Set<V>> getStronglyConnectedComponents()
Graph<V,E> getSubgraph(Collection<V> node, Collection<E> edges)
node
- the collection of vertices used to create the subgraphedges
- the collection of edges used to create the subgraphCopyright © 2005–2020. All rights reserved.