Skip to content

GDeniseSR/Python-Physics-based-Graph-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics-based Graph Visualizer

Simple graph visualizer and editor.

Example.Graph.Visualizer.mp4

Features

  • Force-based node placement: nodes repel each other and edges act like springs, dynamically adjusting to keep the layout tidy.
  • Interactive editing: add, remove, and connect nodes using your mouse (click and drag) and basic camera.
  • Supports directed graphs with arrowed edges.
  • Dynamic component coloring: each connected component is assigned a unique color.
  • Cut vertex highlighting: vertices that, when removed, increase the number of connected components are outlined in red.

Graph class:

Generic, versioned graph implementation supporting directed/undirected and weighted/unweighted graphs.

  • Adjacency dictionary storage.
  • Add/remove vertices and edges.
  • Detect if directed, reverse edges, extract subgraphs.
  • BFS/DFS traversal.
  • Connected components / strongly connected components.
  • Cut vertices (Tarjan’s algorithm for non directed graphs).
  • Strong articulation points (Implemented the following paper: "Finding strong bridges and strong articulation points in linear time, by Giuseppe F. Italiano, Luigi Laura, Federico Santaroni")
  • Dijkstra shortest paths.

Getting Started

Requeriments

Install dependencies with:

pip install -r requirements.txt

Running program

Run either 'example/ShowDirectedGraph.py' or 'example/ShowHousesGraph.py' from the project root for example graphs based on Game of Thrones:

python -m example.ShowDirectedGraph
python -m example.ShowHousesGraph

Controls:

  • Left Click on empty space: Create a new node.
  • Left Click + Drag from one node to another: Create an edge.
  • Right Click + Drag: Delete edges that the drag line crosses.
  • Middle Mouse Button (or scroll-wheel) drag: Pan the camera.
  • Mouse Wheel: Zoom in and out.

About

Python Physics-based Graph Visualizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages