Skip to content

Some small optimizations for Edmonds maximum cardinality matchings - #700

Merged
jkinable merged 2 commits into
jgrapht:masterfrom
d-michail:edmonds-mcm-optimization
Nov 12, 2018
Merged

jkinable merged 2 commits into
jgrapht:masterfrom
d-michail:edmonds-mcm-optimization

Conversation

@d-michail

Copy link
Copy Markdown
Member

A few minor optimizations for our maximum cardinality matching. They improve the performance slightly, but not what I was expecting.

We still need to do some profiling to figure out why it is slow on sparse graphs.


@d-michail
d-michail requested a review from jkinable October 20, 2018 13:39
/**
* Storage of the forest, even and odd levels.
*
* We explicitly maintain a dirty mark in order to be able to cleanup only the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you certain that just resetting the dirty bits as opposed to resetting the entire even/odd arrays is sufficient? I can't remember the exact details, but could it be the case that not resetting the entire array leads to errors? E.g. if you labeled a vertex in the previous augmenting round which should receive a different label in the new round?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We call levels.reset() in each round, which means that the even/odd arrays always start as completely initialized.

@jkinable jkinable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left 1 comment which I'm not really certain of. Please verify. Looks good otherwise.

@jkinable
jkinable merged commit fdd5c35 into jgrapht:master Nov 12, 2018
@jkinable

Copy link
Copy Markdown
Collaborator

thanks!

@d-michail
d-michail deleted the edmonds-mcm-optimization branch November 12, 2018 16:09
SChudakov pushed a commit to SChudakov/jgrapht that referenced this pull request Jan 9, 2019
…grapht#700)

* Performance optimizations for Edmonds Maximum Cardinality Matchings

* Minor improvements in the docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants