Terminé

Breadth first Search in C++

**Programming Problem**

Code the *BFS (Breadth First Search)* algorithm from Chapter 22 in the text. (see the attached file for the algorithm) Then run the *Print*-*Path* algorithm from the same chapter. The graph data will be input from a file.

Your program should prompt the user for a source vertex when the *BFS* is run. Using the same source, it should also prompt the user for a destination vertex when *Print*-*Path* is run.

** **

**Submission requirements**

Name the driver file **[url removed, login to view]**. The implementation file **[url removed, login to view]** and the header file **graph.h**

**Program requirements**

1. Read the data file from the command line. It will be in argv[1]. Thus, the header of your **main** function should look like this.

int main(int argc, char* argv[ ])

2. Display the graph as an adjacency list **_or_** adjacency matrix with vertex labels, then prompt the user to enter a source vertex (for BFS and Print-Path) and a destination vertex (for Print-Path).

3. Run your BFS algorithm from the chosen source.

4. Run Print-Path and display the entire path. For example, **s-t-u-x** where **s** is the source (root) and **x** is the destination.

**Format of data file**

You may assume the data will be in the following format. The data is for an undirected graph.

4 5 undirected // Number of vertices, space, number of edges, space, graph type

r s t z // Space delimited vertex labels

r s // Edge (r,s)

r z

r t

s t

t z

**Additional Requirements**:

Be sure to use good program style (pre/post conditions, header comments, sparse code comments, self-documenting names, whitespace, indentation, etc.).

## Deliverables

C++ source code for the above problem.

## Platform

The code

**_must_** compile on a g++ compiler.

*_Please feel free to ask me any questions that you might have about the BFS algorithm or the programming assignment_*.

**_THE DUE DATE FOR THIS IS SUNDAY JULY 25TH 2004_**.

Compétences : Programmation C, Ingénierie, MySQL, PHP, Architecture Logicielle, Tests de Logiciels

en voir plus : breadth search source code, source code bfs, source code breadth search, vertices on a graph, use of algorithm in programming, text search algorithm, sparse matrix in c, self programming, search in code, search graph, search algorithm in c, search algorithm example, programming with cpp, programming in r, programming graph, programming algorithm questions, programming algorithm example, problem graph, post it graph, path of a graph

Concernant l'employeur :
( 27 commentaires ) United States

Nº du projet : #3288372

Décerné à:

mcduckvw

See private message.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 4 jours
(36 Commentaires)
4.9

11 freelance font une offre moyenne de $19 pour ce travail

DanD

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(212 Commentaires)
5.8
lmxvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(126 Commentaires)
4.7
mephvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(30 Commentaires)
4.3
lucasrekucki

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(8 Commentaires)
3.5
harryhaller

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(18 Commentaires)
3.2
vw1212371vw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(4 Commentaires)
1.5
kompooter

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(3 Commentaires)
0.7
kramsoft

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(2 Commentaires)
0.0
gurukulvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(0 Commentaires)
0.0
kirikavw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(0 Commentaires)
0.0