GraphTools is a toolkit that can calculate useful things about weighted and unweighted graphs.
- Calculating shortest or longest distance between nodes (weighted and unweighted)
- Topological sorting
- Finding strongly connected components
- Finding minimum and maximum spanning tree
More features coming soon.
- Dijkstra's algorithm (Shortest path)
- BFS algorithm (Shortest path)
- Kruskal's algorithm (Minimum or maximum spanning tree)
Note: command line arg parsing is not yet implemented!
For example, if you'd like to calculate shortest path between two nodes using Dijkstra's algorithm:
java -jar GraphTools.jar graph.json shortestPath dijkstra 1 5
Will return (depending on the graph):
42
For shortest spanning tree of a graph:
java -jar GraphTools.jar graph.json shortestSpanningTree kruskal
3 --> 4 (weight: 7)
2 --> 4 (weight: 6)
1 --> 3 (weight: 4)
To do
To do
- Floyd-Warshall's algorithm
- Bellman-Ford's algorithm
- DFS algorithm
- Kruskal's algorithm
- Prim's algorithm
Copyright (C) 2017 alehuo
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.