Cover the board with the right shapes using Pyomo.
Beautiful Barcelona

Cover the board with the right shapes using Pyomo.

Consider the following 10*10 board. There are 6 distinct shapes that you need to use to cover the board (as far as possible). The following rules should be respected:

  • There is enough number of each shape available
  • Every two shapes should not overlap (the most difficult one)
  • If shape i is used n_i times then shape j less that | n_i-d | times.
  • All the placed shapes should remain within the board's boundries


No alt text provided for this image

The idea is simple ! Each cell should not be covered more than once . But how to write it mathematically?

if we put a shape s on cell i (there are N^2 cells) it will cover some specific cells j

We can store these cells for each individual (i,s) and call it cover (it is a dictionary in python)

Here is the problem formulation: (it is mixed integer linear )

No alt text provided for this image

Here is the Pyomo code: (solved with CBC solver and visualised in Matplotlib)

No alt text provided for this image


No alt text provided for this image

for a 20*20 board:

No alt text provided for this image
No alt text provided for this image

The applications:

  • Covering an area with assets of different shapes
  • Covering the project skills with team members with different skillsets
  • Effective radiology
  • Solving your weekend puzzles quickly
  • Distracting you from other things

Subscribe to the?Newsletter?to have access to the upcoming posts and follow?#pyomo4all?for more!

You may also contact?me?!

Donald McCarthy

Infrastructure specialist. at Graphcore UK.

2 年

I guess if you had large sheets of plywood and assorted shapes to cut out then a similar technique could be used to minimise wastage? But that's a different problem :-) Interesting.

CHESTER SWANSON SR.

Realtor Associate @ Next Trend Realty LLC | HAR REALTOR, IRS Tax Preparer

2 年

Thanks for Sharing.

farshid hesami

Lead Design Engineer | Machine Learning | Deep Learning | Computer Vision | Data Analysis | Statistics | Decision Making | Science engineer | Researcher

2 年

??

要查看或添加评论,请登录

Alireza Soroudi, PhD的更多文章

社区洞察

其他会员也浏览了