10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

breadth‐first search to uniform‐cost search which considers the path costs.<br />

Nevertheless, if the graph is not weighted, and therefore all step costs are<br />

equal, breadth‐first search will find the nearest and the best solution.<br />

Applications of BFS:‐<br />

• Breadth‐first search can be used to solve many problems in graph<br />

theory, for example:<br />

• Finding all connected components in a graph.<br />

• Finding all nodes within one connected component<br />

• Copying Collection, Cheney's algorithm<br />

• Finding the shortest path between two nodes u and v (in<br />

an unweighted graph)<br />

• Finding the shortest path between two nodes u and v (in a weighted<br />

graph: see talk page)<br />

• Testing a graph for bipartiteness<br />

• (Reverse) Cuthill–McKee mesh numbering<br />

Minimum Spanning Tree:<br />

A minimum spanning tree is a subgraph of an undirected weighted graph G,<br />

such that<br />

• it is a tree (i.e., it is acyclic)<br />

• it covers all the vertices V<br />

– contains |V| ‐ 1 edges<br />

• the total cost associated with tree edges is the minimum among all<br />

possible spanning trees<br />

• not necessarily unique<br />

A spanning tree is a tree that contains all of the vertices in the graph. The<br />

minimum spanning tree is a spanning tree in which the total weight of the lines<br />

are guaranteed to be the minimum of all possible trees in the graph.<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 92 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!