Hai, Any Idea abt Edge list. Can anybody explain it when or how we
have to use it??
Thanks. Every poster
Any idea abt Edge list
Moderator: Board moderators
Any idea abt Edge list
babor
Specifics
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.