Skip to content

Does not match when vertices have the same value #2

@d5h

Description

@d5h

Hi,

Thanks for writing graphmatch! It's a very nice Ruby gem for solving a useful problem.

I noticed an issue however where graphmatch does not return matches when vertices on either side of the bipartite graph have the same value. For example:

left = [1]
right = [1]
edges = {1 => {1 => 0}}
Graphmatch.match(left, right, edges, search = :min_cost)
=> {:source=>1}

Theoretically this makes sense. However, it's a common case in practice.

Another related case is when vertices on the same side of the graph have the same value:

left = [1, 2]
right = [3, 3]
edges = {1 => {3 => 0},
               2 => {3 => 1}}
Graphmatch.match(left, right, edges, search = :min_cost)
=> {1=>3}

Again, this makes sense because the library is identifying vertices by their value, rather than vertices having a value.

There are workarounds, but it would be nice if the issue was fixed or documented. I spent a fair amount of time just figuring out what was happening.

Again, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions