This project is a Graph Visualizer built with JavaFX.
- It reads an undirected graph from a
graph.txtfile. - Uses a force-directed algorithm to position nodes dynamically.
- Displays nodes as circles with numbers.
- Draws edges in random colors for better visualization.
- Clone the repository:
git clone https://github.com/user/graph-visualiser.git cd graph-visualiser - Run the application:
mvn clean compile exec:java
The input file describes an undirected graph:
- First line → Number of nodes.
- Each following line → Edge
u v, whereuandvare connected nodes.
20
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 0
0 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 10
3 17
6 12
8 14
5 11
1 15
7 19
- Java 21
- JavaFX 21 (for visualization)
- Maven (dependency management)
- Force-Directed Algorithm for node positioning
