public interface IGraph
Modifier and Type | Method and Description |
---|---|
boolean |
addNode(int x)
Adds node x to the node set of the graph
|
int |
getNbMaxNodes()
The maximum number of nodes in the graph
Vertices of the graph belong to [0,getNbMaxNodes()-1]
This quantity is fixed at the creation of the graph
|
ISet |
getNodes() |
ISet |
getPredOrNeighOf(int x)
Get either x's predecessors or neighbors.
|
ISet |
getSuccOrNeighOf(int x)
Get either x's successors or neighbors.
|
SetType |
getType()
Get the type of data structures used in the graph
|
boolean |
isArcOrEdge(int x,
int y)
If
this is directed
returns true if and only if arc (x,y) exists
Else, if this is undirected
returns true if and only if edge (x,y) exists
This method enables to capitalize some code but should be called with care |
boolean |
isDirected() |
boolean |
removeNode(int x)
Remove node x from the graph
|
ISet getNodes()
boolean addNode(int x)
x
- a node indexboolean removeNode(int x)
x
- a node indexint getNbMaxNodes()
SetType getType()
ISet getSuccOrNeighOf(int x)
x
- a node indexthis
is directed
x's neighbors otherwiseISet getPredOrNeighOf(int x)
x
- a node indexthis
is directed
x's neighbors otherwiseboolean isArcOrEdge(int x, int y)
this
is directed
returns true if and only if arc (x,y) exists
Else, if this
is undirected
returns true if and only if edge (x,y) exists
This method enables to capitalize some code but should be called with carex
- a node indexy
- a node indexboolean isDirected()
this
is a directed graphCopyright © 2016. All rights reserved.