hopcroft-karp | Finds a maximum matching of a bipartite graph
kandi X-RAY | hopcroft-karp Summary
kandi X-RAY | hopcroft-karp Summary
Finds a maximum matching of a bipartite graph
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hopcroft-karp
hopcroft-karp Key Features
hopcroft-karp Examples and Code Snippets
Community Discussions
Trending Discussions on hopcroft-karp
QUESTION
I am trying to get a matching between two sets of vertices, one represents meets between two teams and the other time slots when the meets could happen. The adjacency map represents both teams' availability to meet at any given time slot. This would be bipartite matching. The problem is that I want to constraint this so that any team will not be assigned to consecutive time slots, more specifically to time slots in two consecutive days.
So, I've tried adding a check right before adding an edge to the match, at the end of the augmenting path, that checks the previous day's and following day's time slots, if they have been matched to a meet with any of the teams in the meet about to match. I tried it with Hopcroft-Karp and with DFS. It didn't work.
Is this not bipartite matching anymore?
Any help will be greatly appreciated.
EDIT:
As suggested in the answer below, I am trying to implement this as an integer linear program. The following code is heavily based on the example from Google OR-tools on assignment matching As it is, it seems to work correctly for matching, but without my specified constraint.
...ANSWER
Answered 2020-Jun-24 at 16:20We could have an integer linear program, where each constraint for a team to meet includes two additional before
variables. For example, for team A to meet on day 4:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hopcroft-karp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page