Lecture14 - Algorithms in Systems Engineering IE170 Lecture...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Algorithms in Systems Engineering IE170 Lecture 14 Dr. Ted Ralphs IE170 Lecture 14 1 References for Todays Lecture Required reading CLRS Chapter 22 References R. Sedgewick, Algorithms in C++ (Third Edition), 1998. IE170 Lecture 14 2 Operations on Graphs Last lecture, we saw an algorithm that could be used to analyze the connectivity of a graph without actually storing the graph. In discarding the list of edges, we lose a great deal of information about the structure of the graph. In many cases, we need to make use of that information to perform other operations. What are the basic operations we might want to perform on a graph if we could store it somehow? IE170 Lecture 14 3 Graph Interface Class class Graph{ private: // Implementation dependent code public: Graph(int); ~Graph(); int V() const; int E() const; int insert(Edge e); int delete(Edge e); bool edge(int v, int w) const; Vertex* getFirst(int i); }; IE170 Lecture 14 4 Vertex and Edge Classes class Edge{ public: Edge(int i, int j): v(i), w(j) {} ~Edge(); int v, w; }; class Vertex{ private: // Imlementation dependend code public: int getIndex() const; Vertex const * getNext() const; } IE170 Lecture 14 5 A Client Function for Printing a Graph Heres an example of a standard way in which the graph interface class is used....
View Full Document

This note was uploaded on 02/29/2008 for the course IE 170 taught by Professor Ralphs during the Spring '07 term at Lehigh University .

Page1 / 16

Lecture14 - Algorithms in Systems Engineering IE170 Lecture...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online