All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Lib.Krakatau.graph_util.pyc Maven / Gradle / Ivy

There is a newer version: 1.1
Show newest version
?
?HRc@s(ddlZd?ZeZd?ZdS(i????NcCsg}tj?}i}i}t?}g}g|D]}|df^q4}	x?|	r|	j?\}
}|dkr?|
|krt|?||
<||
si????(t	itertoolstcounttsettpoptnexttappendtextendtmintAssertionErrorttupletupdate(trootstgetChildrentsccstindexCountertindextlowlinktremovedtsubtreetnodetstacktcurrenttstateRtchildrentscc((s:/home/alex/projects/github/krakatau/Krakatau/graph_util.pyt	tarjanSCCs:		+
+
cCs?g}t?}g|D]}|df^q}x?|r?|j?\}}|dkr?||kr?|j|?|j|df?|jd?||?D??q?q1||ks?t?|j|?q1W|S(s?Return a topological sorting of nodes in a graph.

    roots - list of root nodes to search from
    getParents - function which returns the parents of a given node
    iicss|]}|dfVqdS(iN((Rtparent((s:/home/alex/projects/github/krakatau/Krakatau/graph_util.pys	Bs(RRtaddRRR
(R
t
getParentstresultstvisitedRRRR((s:/home/alex/projects/github/krakatau/Krakatau/graph_util.pyttopologicalSort0s		
#(RRtstronglyConnectedComponentsR!(((s:/home/alex/projects/github/krakatau/Krakatau/graph_util.pyts	+




© 2015 - 2025 Weber Informatics LLC | Privacy Policy