Skip to content

This project is about graph algorithms.

anisafqh/Graph-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Graph Algorithm

This project is about graph algorithms. Data structures that utilized is an adjacency list. This project programs to solve three problems, which are to check if the default graph is strongly connected, has a cycle, and compute the shortest path. The main graph functions in this project are add edge, delete edge, reset graph, random edge and print graph.

Default graph: image Implementation of the graph using adjacency list: {('Tokyo', 'HochiMinh'): 4329, ('HochiMinh', 'Los Angeles'): 13135, ('Los Angeles', 'Asmara'): 14015, ('Prague', 'Asmara'): 4450, ('Tokyo', 'Prague'): 9073, ('Asmara', 'Tokyo'): 9961, ('Los Angeles', 'Tokyo'): 8811

Graph Functions

  1. Add edge
  2. Remove edge
  3. Strong connectivity in graph
  4. Cycle detection in graph
  5. Shortest path in graph
  6. Reset graph

This program allows user to choose different functions:

image

Add edge function: The program will ask source node, destination node and also destination weight for user to enter. Then, the program will display updated adjacency list of the cities with added edge.

image

Remove edge function: The program will ask source node and destination node to delete. Then, the program will display updated adjacency list of current cities.

image

Strong connectivity function: This function will determine whether the graph is strong connectivity or not.

image

Cycle detection function: This function will determine whether the graph has a cycle or not.

image

Shortest path function: This function allow user to select two vertices and compute the shortest path. The program will print the shortest path and add random edges if there is no path between the chosen vertices.

image

About

This project is about graph algorithms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages