Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maximum number of dominoes can be placed inside a figure

Tags:

algorithm

max

Suppose some figure on the squared paper. Sides of the figure go straight on the lines of squared paper. Figure may have any (not even convex) shape. How to find the maximum number of dominoes (1x2 rectangular) that can be placed in that figure. It is not allowed to put domino over another one. It is allowed to put domino only in such way, when its sides fall exactly on the lines of squared paper.

like image 595
Sergey Demyanov Avatar asked Jan 24 '11 09:01

Sergey Demyanov


1 Answers

Looks like the maximum cardinality matching problem in a bipartite graph. The squares are the vertices and the dominoes are the edges that belong to the matching.

To see that the graph is bipartite, imagine the squares are checkerboard-painted. Black ones only neighbour white ones and vice versa.

like image 198
Rafał Dowgird Avatar answered Sep 28 '22 18:09

Rafał Dowgird