Class GraphAlgorithms
java.lang.Object
org.episteme.core.mathematics.discrete.GraphAlgorithms
Graph algorithms including traversal, shortest paths, and connectivity.
Implements classic graph algorithms for analyzing graph structures and finding optimal paths.
References
- Edsger W. Dijkstra, "A Note on Two Problems in Connexion with Graphs", Numerische Mathematik, Vol. 1, 1959, pp. 269-271
- Thomas H. Cormen et al., "Introduction to Algorithms", 3rd Edition, MIT Press, 2009 (comprehensive coverage of graph algorithms)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> List<V> breadthFirstSearch(Graph<V> graph, V start) Performs breadth-first search from a starting vertex.static <V> List<V> depthFirstSearch(Graph<V> graph, V start) Performs depth-first search from a starting vertex.static <V> booleanisConnected(Graph<V> graph) Checks if the graph is connected (for undirected graphs).static <V> List<V> shortestPath(Graph<V> graph, V start, V end) Finds shortest path using Dijkstra's algorithm (unweighted = BFS).
-
Constructor Details
-
GraphAlgorithms
public GraphAlgorithms()
-
-
Method Details
-
breadthFirstSearch
-
depthFirstSearch
-
isConnected
Checks if the graph is connected (for undirected graphs).- Type Parameters:
V- vertex type- Parameters:
graph- the graph- Returns:
- true if connected
-
shortestPath
-