Package com.javaholics
Interface GraphAlgorithmsInterface<T>
- All Known Implementing Classes:
GraphAlgorithms
public interface GraphAlgorithmsInterface<T>
An interface of methods that process graphs.
- Author:
- Lindsay Kislingbury, Lea Wiranatha
-
Method Summary
Modifier and TypeMethodDescriptiongetBreadthFirstTraversal
(T origin) Performs a breadth-first traversal of this graph.getDepthFirstTraversal
(T origin) Performs a depth-first traversal of this graph.
-
Method Details
-
getBreadthFirstTraversal
Performs a breadth-first traversal of this graph.- Parameters:
origin
- An object that labels the origin vertex of the traversal.- Returns:
- A queue of labels of the vertices in the traversal, with the label of the origin vertex at the queue's front.
-
getDepthFirstTraversal
Performs a depth-first traversal of this graph.- Parameters:
origin
- An object that labels the origin vertex of the traversal.- Returns:
- A queue of labels of the vertices in the traversal, with the label of the origin vertex at the queue's front.
-