~ubuntu-branches/ubuntu/utopic/python-networkx/utopic

« back to all changes in this revision

Viewing changes to networkx/algorithms/components/strongly_connected.py

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2011-03-19 12:19:16 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110319121916-xrhlpiwc9sa5e028
Tags: 1.4-1
* New upstream release; thanks to Yaroslav Halchenko for the report;
  Closes: #617677
* debian/rules
  - don't compress objects.inv; thanks to Michael Fladischer for the report;
    Closes: #608780
* debian/watch
  - updated to point to PyPi
* debian/control
  - bump python-sphinx versioned b-d-i to 1.0.1 minimum
  - added python-pygraphviz to b-d-i, needed for doc building
* debian/copyright
  - bump upstream and packaging copyright years
* debian/patches/{40_add_networkxcss, 50_boundary-test-fix.patch
                  60_remove_svn_refs.diff 70_set_matplotlib_ps_backend.patch}
  - removed since merged upstream
* debian/patches/{10_doc_relocation, 20_example_dirs_remove,
                  30_use_local_objects.inv}
  - refreshed/adapted to new upstream code

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
    Uses Kosaraju's algorithm.
123
123
    """
124
124
    components=[]
125
 
    post=nx.dfs_postorder(G,source=source,reverse_graph=True)
 
125
    G=G.reverse(copy=False)
 
126
    post=list(nx.dfs_postorder_nodes(G,source=source))
 
127
    G=G.reverse(copy=False)
126
128
    seen={}
127
129
    while post:
128
130
        r=post.pop()
129
131
        if r in seen:
130
132
            continue
131
 
        c=nx.dfs_preorder(G,r)
 
133
        c=nx.dfs_preorder_nodes(G,r)
132
134
        new=[v for v in c if v not in seen]
133
135
        seen.update([(u,True) for u in new])
134
136
        components.append(new)