Skip to content

nettok/graph-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph Editor

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.

Features

  • 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.

Usage Guide

Running the Program

  1. Install Rust: If you don't have Rust installed, follow the instructions at rustup.rs.
  2. Clone the Repository:
    git clone https://github.com/nettok/graph-editor.git
    cd graph-editor
  3. Run the Program:
    cargo run --release

Creating and Editing Nodes

  • Add a Node: Press N pointing anywhere on the canvas to add a new node.
  • Edit Node Label:
    1. Enter a label in the "Node label" text input field.
    2. Click on the label of a node to update it.

Creating and Editing Edges

  • Add an Edge:
    1. Click on a node to select it.
    2. Hover over another node and press the E key to create an edge.
  • Edit Edge Weight:
    1. Enter a weight in the "Edge weight" text input field.
    2. Click on the weight label of an edge to update it.

Screenshots

Demo

Dependencies

  • eframe: Framework for building native GUI applications.
  • egui: Immediate mode GUI library.

About

Visually create graphs and find the shortest path.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages