A simple graph editor built in Rust using the egui
library. This tool allows you to create, edit, and visualize graphs with nodes and edges. You can also solve for the shortest path between two nodes using Dijkstra's algorithm.
- Create Nodes: Press
N
to add a node on the mouse pointer position. - Edit Node Labels: Click on a node's label to update it.
- Create Edges: Select a node, hover over another node, and press
E
to create an edge. - Edit Edge Weights: Click on an edge's weight label to update it.
- Set Start and End Nodes: Specify start and end nodes to solve for the shortest path.
- Solve Shortest Path: Click the "Solve" button to compute the shortest path using Dijkstra's algorithm.
- Visualize Path: The shortest path is highlighted, and the distance and path are displayed.
- Install Rust: If you don't have Rust installed, follow the instructions at rustup.rs.
- Clone the Repository:
git clone https://github.com/nettok/graph-editor.git cd graph-editor
- Run the Program:
cargo run --release
- Add a Node: Press
N
pointing anywhere on the canvas to add a new node. - Edit Node Label:
- Enter a label in the "Node label" text input field.
- Click on the label of a node to update it.
- Add an Edge:
- Click on a node to select it.
- Hover over another node and press the
E
key to create an edge.
- Edit Edge Weight:
- Enter a weight in the "Edge weight" text input field.
- Click on the weight label of an edge to update it.