Skip to content

wrong/incomplete test TestNetworkSimplex:test_digraph2 (migrated from Trac #722) #708

Closed

Description

@networkx-trac

Original ticket https://networkx.lanl.gov/trac/ticket/722
Reported 2012-05-04 by @mfrasca, assigned to @hagberg.

the test case TestNetworkSimplex:test_digraph2 is not the same as the one it refers to (http://www.cs.princeton.edu/courses/archive/spr03/cs226/lectures/mincost.4up.pdf, slide 11). in this sense it's "wrong".

it is incomplete because it tests max_flow_min_cost without defining cost (weight).

the correct and complete graph is
'''
G.add_edge(1, 2, capacity=11, weight=4)
G.add_edge(2, 3, capacity=9, weight=6)
G.add_edge(1, 4, capacity=5, weight=5)
G.add_edge(1, 5, capacity=2, weight=12)
G.add_edge(2, 5, capacity=4, weight=4)
G.add_edge(2, 6, capacity=2, weight=6)
G.add_edge(3, 6, capacity=31, weight=3)
G.add_edge(4, 5, capacity=18, weight=4)
G.add_edge(5, 6, capacity=9, weight=5)
'''

and the solution is:
'''
soln = {1: {2: 6, 4: 5, 5: 1},
2: {3: 6, 5: 4, 6: 2},
3: {6: 20},
4: {5: 2, 't': 3},
5: {6: 0, 't': 7},
6: {'t': 22},
's': {1: 12, 2: 6, 3: 14},
't': {}}
'''

Activity

  1. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Attachment in Trac by @mfrasca, 2012-05-04: patch722-1.diff

  2. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Comment in Trac by Aric Hagberg <aric.hagberg, 2012-05-04

    In [changeset:eeadf7325d1f97fbd362ff03a4a69a0400c70ce1/networkx]:
    '''
    #!CommitTicketReference repository="networkx" revision="eeadf7325d1f97fbd362ff03a4a69a0400c70ce1"
    Fix error in mincost example.
    Fixes #722
    '''

  3. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Comment in Trac by @hagberg, 2012-05-04

  4. mfrasca commented on Oct 23, 2012

    @mfrasca

    attaching my github account to the migrated issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions