ch.bfh.algo.example
Class GraphStress
java.lang.Object
ch.bfh.algo.example.GraphStress
public class GraphStress
- extends Object
The class GraphStress
contains Stess Tests for the Graph
- Version:
- 1.0
- Author:
- Emmanuel Benoist
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphStress
public GraphStress()
dfsTraversal
public static Sequence<ch.bfh.algo.example.GraphStress.DecoratedVertex> dfsTraversal(Graph<Integer,String> g,
List<Position<String>> vertices)
- The
dfsTraversal
is an example of the possible
implementation of a Depth First Search traversal of a
Graph
. In this case, we use the
DecoratedVertex
to store inside each vertex if it
has been visited.
- Returns:
- a
Sequence
value
reverseAllEdges
public static void reverseAllEdges(Graph<Integer,String> g)
constructDirectedGraph
public Graph<Integer,String> constructDirectedGraph(int numberOfVertices,
int numberOfEdges)
- The
constructDirectedGraph
method is used to
initialize a default directed Graph
.
The returned graph contains numberOfVertices
vertices and
numberOfEdges
directed edges.
- Returns:
- a
Graph
value
run
public void run()
main
public static void main(String[] args)