Skip to content

Added conflict handling without redefining the algorithms - #1

Open
surdykaw wants to merge 7 commits into
masterfrom
one-dim-BPPC-implementation
Open

Added conflict handling without redefining the algorithms#1
surdykaw wants to merge 7 commits into
masterfrom
one-dim-BPPC-implementation

Conversation

@surdykaw

@surdykaw surdykaw commented Jul 17, 2026

Copy link
Copy Markdown
Member

Hello,
I've made a few changes to the Vectorpack code.
Here are some of the most important:

  1. I added the --with-conflicts option to the main program, then propagated it with the with_conflicts parameter through the Instance class constructor.
  2. I added an adjacency list vector to the Instance class in order to keep the conflicts read from a BPPC instance file. I think it is relevant to store the conflicts here, as conflict constraints are a part of an instance file itself. Let me know if there is a better way to handle it, so we could improve the storing way.
  3. Befriended the retrieveSizeLists function with Instance class, and redefined it. First, I decided to pass the Instance pointer to the function, instead of the capacity list, so now one can reference both to the adjacency_list vector and capacity list directly. Also pass the item_id and with_conflicts values here.

Edit: I've forgot the most important thing... Also added the doesItemConflict method, which compares the current item id with the already allocated items' adjacency lists. Next, the checkItemToBin uses this method to decide whether an allocation is feasible, or not.

Now, the implementation is compatible with the VBP format and uses same solving algorithms, as for other problems.

@surdykaw
surdykaw requested a review from Mommessc July 17, 2026 22:37
Detect item size vector mismatch
Init adjacency list size only if with_conflicts option is set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants