Algorithm of the Week: Topological Sort of a Graph | Architects Zone 1. Make an empty list L and an ...

Please Visit: http://ift.tt/1ajReyV



Algorithm of the Week: Topological Sort of a Graph | Architects Zone

1. Make an empty list L and an empty list S;

2. Put all the vertices with no predecessors in L;

3. While L has items in it;

3.1. Pop an item from L – n, and push it to S;

3.2. For each vertex m adjacent to n;

3.2.1. Remove (n, m);

3.2.2. If m has no predecessors – push it to L;

http://ift.tt/1mTrHGX

http://ift.tt/1t1QdXk



Algorithm of the Week: Topological Sort of a Graph | Architects Zone







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1mTrHXa

via LifeLong Community

No comments:

Post a Comment