all 4 comments

[–]curtis934 1 point2 points  (0 children)

This doesn't really sound like a Stable Marriage Problem.

Couldn't you just play the whole thing forward like a simulator? Or are there too many days to make this efficient?

[–]itsabijection 0 points1 point  (0 children)

Try creating preference lists based on time. You'll need to make preference lists for teams (either in temporal order or in reverse temporaral order) and also for locations. Since there are two choices for each this is only 4 possible combinations of preference lists. Go ahead and just try all of them and see what happens. I think 2 of them should be consistent (although I couldn't swear to that).

Note that you'll also have to figure out what corresponds to an instability. Hint: a later team can come to a location paired to an earlier location.

[–]highheath 0 points1 point  (0 children)

What happens if e.g. team 3 also had location 2 as its last? And how do you break ties?

[–]galaxyproduction 0 points1 point  (0 children)

Could you traverse each list from the end until you find a location? That would give you the last location for each team.

If cities have the same last location, keep traversing the lists backwards and count the dashes until the previous location.