kotarot / rectangle-packing-solver

A solver to find a solution of the 2D rectangle packing problem by simulated annealing (SA) optimization.
Apache License 2.0
87 stars 17 forks source link

Same Value Of 2 Rectangle = No Results #35

Open arncode90 opened 2 years ago

arncode90 commented 2 years ago

Im getting nothing from the same rectangles = (4, 4), (4, 4)

But its working if im using = (4, 3), (4, 4)

import rectangle_packing_solver as rps

# Define a problem
problem = rps.Problem(rectangles=[
    (4, 3),
    (4, 4),
])

print("\n=== Solving without width/height constraints ===")
solution = rps.Solver().solve(problem=problem, show_progress=True)
print("solution:", solution)
arncode90 commented 2 years ago

I found out that if using the same W/L of rectangle, need to set the solve(width_limit=VALUE, height_limit=VALUE)

kotarot commented 2 years ago

@catherinezera88 I'll also look into this issue. Thank you for finding it!