Branch-Bound-Algorithm icon indicating copy to clipboard operation
Branch-Bound-Algorithm copied to clipboard

Rather then FIFO, can you please modify it for LIFO.

Open ankrth1201 opened this issue 6 years ago • 4 comments

i am getting issues when i am converting it for depth first search (LIFO), can you please provide me solution on that.

ankrth1201 avatar Mar 23 '19 19:03 ankrth1201

@ankrth1201 Hello, I did an initial mistake and the method is LIFO. You can see that if you go on ./controllers/default.py on line 124. I select the las node that I inserted. So if you want to change that now to FIFO you can do branch_node=node_list[0] to branch_node=node_list[-1]. Hope that helps. EDIT: It could be an option in the future that the user can select

amanolar94 avatar Apr 01 '19 08:04 amanolar94

hello @amanolar94 ,i don't think it is LIFO because every time you are selecting the first node from the node list and then branching the node which was inserted in very starting and it is breadth first search because every time you are making two branches on each node, but i am looking for depth first search that it make node only in one direction (mean branching by taking only one constraint until it is pruned or cannot be further branched then another constraint is added on that particular branch) i hope you understand my issue here.

ankrth1201 avatar Apr 01 '19 08:04 ankrth1201

@ankrth1201 you are correct it is indeed FIFO since i add new elements to the list with the .append() method therefore the last entered branch is last on the list. So if we did branch_node=node_list[-1] instead of branch_node=node_list[0] wouldn't that be LIFO?

amanolar94 avatar Apr 01 '19 08:04 amanolar94

@amanolar94 actually by LIFO what i meant was depth first search. i will try implementing that and will get back to you.

ankrth1201 avatar Apr 01 '19 09:04 ankrth1201