¡@

Home 

python Programming Glossary: lowlinks

Tarjan's strongly connected components algorithm in python not working

http://stackoverflow.com/questions/6575058/tarjans-strongly-connected-components-algorithm-in-python-not-working

itertools def strong_connect vertex global edges indices lowlinks connected_components index stack indices vertex index lowlinks.. connected_components index stack indices vertex index lowlinks vertex index index 1 stack.append vertex for v w in e for e.. e in edges if e 0 vertex if indices w 0 strong_connect w lowlinks v min lowlinks v lowlinks w elif w in stack lowlinks v min lowlinks..