Question: C++ Graphs Help! The Assignment: Reachability from a source vertex s is the problem to find the set of vertices S such that v S

C++ Graphs Help!

The Assignment:

Reachability from a source vertex s is the problem to find the set of vertices S such that v S if exists a path from s to v. You will create a C++ program to find reachable vertices using Breath First Search (BFS) algorithm.

There is an imput file with an sparse matrix. Given the source the program needs to display all reachable vertices.

 C++ Graphs Help! The Assignment: Reachability from a source vertex s

I really dont know how to approach this problem since our professor did not touch graph theory with us.

I would really appreciate the help.

The graph looks like this:

is the problem to find the set of vertices S such that

Input example for Figure 1 (the last line indicates the matrix dimension n 11) 2 1 1 2 3 1 3 5 1 4 5 1 5 6 1 5 7 1 5 8 1 64 1 7 6 1 9 5 1 10 9 1 11 2 1 Output example (source 2) 1 3 4 5 6 7 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!