Any idea abt Edge list

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
User avatar
babor
New poster
Posts: 16
Joined: Sat Jun 07, 2003 4:23 pm
Contact:

Any idea abt Edge list

Post by babor »

Hai, Any Idea abt Edge list. Can anybody explain it when or how we
have to use it??
Thanks. Every poster
babor

rbuchan
New poster
Posts: 27
Joined: Fri Feb 28, 2003 7:59 am
Contact:

Specifics

Post by rbuchan »

Can you be more specific with the question? If you are speaking of graph theory, where a graph G = (V,E), then there are several ways to handle this. One way is to use a <map>, from the STL. This is a nice type that maps pairs of type <T>. So, if you have a graph that has three nodes and 1 and 2 are connected, and 2 and 3 are connected, then the map would contain the pairs {(1,2), (2,1), (2,3), (3,2)}. There are other algorithms that use an adjacency matrix to represent the graph. From this structure you can continue on to do a shortest path algorithm using either Floyd's or Dijkstra, or an MST using Prim's or Kruskal's.

Post Reply

Return to “Algorithms”