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

« back to all changes in this revision

Viewing changes to networkx/algorithms/tests/test_clique.py

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-08-11 12:41:30 UTC
  • mfrom: (1.4.1) (5.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120811124130-whr6uso7fncyg8bi
Tags: 1.7-1
* New upstream release
* debian/patches/changeset_*
  - removed, included upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        assert_equal(cl,
22
22
                     [[2, 6, 1, 3], [2, 6, 4], [5, 4, 7], [8, 9], [10, 11]])
23
23
 
 
24
    def test_selfloops(self):
 
25
        self.G.add_edge(1,1)
 
26
        cl=list(nx.find_cliques(self.G))
 
27
        rcl=nx.find_cliques_recursive(self.G)
 
28
        assert_equal(sorted(map(sorted,cl)), sorted(map(sorted,rcl)))
 
29
        assert_equal(cl,
 
30
                     [[2, 6, 1, 3], [2, 6, 4], [5, 4, 7], [8, 9], [10, 11]])
 
31
 
24
32
    def test_find_cliques2(self):
25
33
        hcl=list(nx.find_cliques(self.H))
26
34
        assert_equal(sorted(map(sorted,hcl)),
100
108
        assert_equal(H1.nodes(),[1, 2, 3, 4, 5])
101
109
        H2=nx.make_max_clique_graph(G)
102
110
        assert_equal(H1.adj,H2.adj)
 
111
 
 
112
    @raises(nx.NetworkXNotImplemented)
 
113
    def test_directed(self):
 
114
        cliques=nx.find_cliques(nx.DiGraph())