Pratition rectangle into smaller ones containig exactly 1 point, maximize wastelands area

后端 未结 2 935
面向向阳花
面向向阳花 2021-02-11 06:10

Given a rectangle R containing P points, orthogonal with axes, points are natural numbers.

Parcel is a rectangle which:

  • is totally inside
2条回答
  •  无人及你
    2021-02-11 06:50

    I can think of a backtracking and exponentially hard method for starters. You pick your points in some order and each time do either of the following:

    1- Decide to pass a vertical line 2- Decide to pass a horizontal line 3- Decide to ignore

    Until you end-up with 3^n different cases.

    For your own application, you could think of applying some bounding conditions at each iteration, e.g., verify if you have ended up with a parcel with no point inside, then backtrack.

提交回复
热议问题