{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw8 - COP 3530 Assignment 8 Due December 1st 2010 In this...

This preview shows pages 1–3. Sign up to view the full content.

COP 3530 Assignment 8 Due: December 1 st , 2010 In this problem you will implement Dijkstra algorithm on a sample graph. As you may know this algorithm is a graph search algorithm that solves the single- source shortest path problem for an undirected graph with nonnegative edge path costs. We assume that the input graph is given as follows and we want to fine the minimum distance of a specific node, say A, to another node, say F in this example. Your program should find the minimum distance and also the nodes in this minimum path. For example for the graph above the sample output can be like this: Distance from start: 4 f g d a Program’s Format: Your program should include two inner classes to define Nodes and Edges. These two classes are used later to hold properties of the input graph. Thus, two global lists hold the values for nodes and edges and are named “nodes” and “edges”, respectively.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
vector < Node *> nodes ; vector < Edge *> edges ; class Node { public : Node ( char id ) : id ( id ), previous ( NULL ), distanceFromStart (
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern