ch.bfh.algo.example
Class GraphExample1
java.lang.Object
ch.bfh.algo.example.GraphExample1
public class GraphExample1
- extends Object
The class GraphExample1
contains one very simple
example of the ch.bfh.algo.Graph
interface.
This example contains the creation of one simple graph containing 6
vertices and 8 edges, which are all Position
s in our
framework.
- Version:
- 1.0
- Author:
- Emmanuel Benoist
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphExample1
public GraphExample1()
bfsTraversal
public static Sequence<Position<String>> bfsTraversal(Graph<Integer,String> g)
- The
bfsTraversal
is an example (very primitive) of
the possible implementation of a Breadth First Search traversal
of a Graph
- Returns:
- a
Sequence
value
constructUndirectedGraph
public static Graph<Integer,String> constructUndirectedGraph()
- The
constructUndirectedGraph
method is used to
initialize a default undirected Graph
.
The returned graph contains 6 vertices and 8 edges.
- Returns:
- a
Graph
value
ex1
public static void ex1()
main
public static void main(String[] args)