chiark / gitweb /
Convert Tents to use matching instead of maxflow.
authorSimon Tatham <anakin@pobox.com>
Sat, 21 Apr 2018 15:51:03 +0000 (16:51 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 22 Apr 2018 16:04:50 +0000 (17:04 +0100)
commitdcc4d82b23095b07673d7c13cb2439c738a67fa1
tree52ef427c20bedecabea80a93cd6b3d70b8927897
parent000ebc50785c5c066465fc17668ae64975188d04
Convert Tents to use matching instead of maxflow.

Tents needs to construct maximal matchings in two different
situations. One is the completion check during play, in which the
existence of a perfect matching between tents and trees is part of the
win condition; the other is the initial grid generation, in which we
find a _maximal_ matching between the tents we've already placed and
all the possible neighbouring squares that are candidates for the tree
positions. Both of those are switched over.
tents.R
tents.c