This C program allows the user to:
1. Create an adjacency matrix representation of a graph with N cities.
2. Perform breadth-first search (BFS) on the graph to find all cities reachable from a starting city.
3. Check if the graph is connected by performing depth-first search (DFS) from a starting city and checking if all cities are visited.
The program uses arrays to represent the adjacency matrix and queues/stacks for the BFS and DFS algorithms. It prompts the user for options to create the graph, run BFS/DFS searches, and exit.
This C program allows the user to:
1. Create an adjacency matrix representation of a graph with N cities.
2. Perform breadth-first search (BFS) on the graph to find all cities reachable from a starting city.
3. Check if the graph is connected by performing depth-first search (DFS) from a starting city and checking if all cities are visited.
The program uses arrays to represent the adjacency matrix and queues/stacks for the BFS and DFS algorithms. It prompts the user for options to create the graph, run BFS/DFS searches, and exit.
This C program allows the user to:
1. Create an adjacency matrix representation of a graph with N cities.
2. Perform breadth-first search (BFS) on the graph to find all cities reachable from a starting city.
3. Check if the graph is connected by performing depth-first search (DFS) from a starting city and checking if all cities are visited.
The program uses arrays to represent the adjacency matrix and queues/stacks for the BFS and DFS algorithms. It prompts the user for options to create the graph, run BFS/DFS searches, and exit.