Skip to content

GomoryHu.h does not actually compute a Gomory-Hu tree #292

@nwoeanhinnogaehr

Description

@nwoeanhinnogaehr

The Gomoru-Hu tree implementation cites the paper "Very simple methods for all pairs network flow analysis", which starts off by describing a simple algorithm to compute an equivalent-flow tree, which is what GomoryHu.h implements. This is not a Gomory-Hu tree. As the paper explains, all Gomory-Hu trees are equivalent-flow trees, but not vice versa. The equivalent-flow tree is fine if you just want the flow values, but if you actually need to recover the cuts it doesn't work.

Fixing the code to actually compute a Gomory-Hu tree is easy - it only requires adding a couple of additional lines to make it match the "CUT TREE PROGRAM MGH" from section 3.2 of the paper. Asymptotic running time is not affected.

If desired, I would be happy to author a PR with this change.

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