Skip to content

Draw Graphs and Visualize Algorithms (Sorting, Shortest Path, etc,) in Python3 (Pygame)

Notifications You must be signed in to change notification settings

hasnainroopawalla/Algorithm-Visualization-Python3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithm Visualization Python3

Draw Graphs and Visualize Algorithms (Python3)

Built using the Pygame Library

pip install pygame

Graph Traversal

'ADD' button adds a new node to the canvas

Press 's' while cursor is on a node to define it as the source

Press 'd' while cursor is on a node to define it as the destination

Press 'l' while cursor is on a node to initialize a node link. Press 'l' again on another node to complete the link

Press 'Enter' to calculate Path from source to destination

Press 'space' to print the current graph

Path will be drawn using red color

Breadth First Search:

Breadth First Search

Depth First Search:

Depth First Search

Sorting

  • Insertion Sort
  • Bubble Sort
  • Heap Sort
  • Counting Sort
  • Cocktail Shaker Sort
  • Merge Sort
  • Shell Sort
  • Selection Sort
  • Quick Sort

Execute run.py from every folder

Press 'space' to shuffle the list

Press 'Enter' to begin sorting

Modify the 'NUMBER_OF_ELEMENTS' variable in run.py to increase/decrease the number of elements

Insertion Sort:

Insertion Sort

Bubble Sort:

Bubble Sort

About

Draw Graphs and Visualize Algorithms (Sorting, Shortest Path, etc,) in Python3 (Pygame)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages