![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <2d_rectangle_presolve.h>
Given two vectors of non-overlapping rectangles defining two regions of the space: one mandatory region that must be occupied and one optional region that can be occupied, try to build a vector of as few non-overlapping rectangles as possible defining a region R that satisfy:
The function updates the vector of mandatory_rectangles
with R
and optional_rectangles
with optional_rectangles \setdiff R
. It returns true if the mandatory_rectangles
was updated.
This function uses a greedy algorithm that merge rectangles that share an edge.