Repository navigation
Fix priority indices under equality reduction, generated tree storage with soft constraints, and the default objective bound in branch and bound - #4
Conversation
- A priority list holds indices of the original problem, but branching read them as indices of the problem in the workspace, which differs if an equality elimination is installed (read beyond the senses of the reduced problem). The indices are now mapped through eq->keep, and code generation writes the mapped list for a reduced problem. - Generated code allocated (n+1)(nb+1) entries for the working sets of the tree, while the library allocates (n+ns+1)(nb+1) since soft constraints can be part of a working set (write beyond the array). The generated size now includes them. - The default bound DAQP_INF on the objective is finite and was compared with the internal objective 0.5||u||^2 = J + c without the offset c, so nodes of a problem with a large ||v|| were pruned and the problem reported infeasible. The offset is now always added, so that the bound applies to J. Regression test 32_bnb_regressions (fails on the previous code; the first case is detected by AddressSanitizer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Consequence of item 3 for data whose linear term is of the order of |
The bound of branch and bound is now always shifted by the offset c, so the parallel solve shares and applies the same bound as the single solve. The Julia regression test of the default bound now requires that the single and the parallel solve agree, since the objective J of that problem is below the bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
child_order is not compared by daqp_parallel_compatible, so the threads of a parallel solve may use different child orders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
node_selection and node_pool_size are not compared by daqp_parallel_compatible, so the threads of a parallel solve may use different node selections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes three defects of branch and bound on
dyad. A codex review of JuliaComputing/daqp#2 found them in code that predates that PR.ef72ae7).daqp_set_branch_prioritystores indices of the original problem. When an equality elimination is installed,daqp_get_branch_idused them as indices of the reduced problem, which reads beyondwork->sense; AddressSanitizer reports a heap-buffer-overflow. The indices are now mapped througheq->keep, which is in ascending order of the original index, so the lookup is a binary search; eliminated constraints are skipped. Code generation of a reduced problem writes the mapped list.9393ffb). Generated code declaredtree_WS[(n+1)(nb+1)], whilesetup_daqp_bnballocates(n+ns+1)(nb+1), because soft constraints can be part of a stored working set. With ten soft constraints the generated array has 6 entries and the root working set writes 10. The generated size now includes the soft constraints of the generated problem.DAQP_INF= 1e30 is finite. The bound was shifted by the offsetc = 0.5||v||^2 - fponly whenrel_subopt,fval_boundorlbwas set. With the default bound it was therefore compared with the internal objectiveJ + cinstead ofJ.0.5x^2 + 2e15 xwith x binary is reported infeasible instead of x = 0 with objective 0.Jitself exceeds 1e30 are still pruned, but problems with a largecand a moderateJare no longer. This is the behaviour the parallel solve in JuliaComputing/daqp#1 needs, since it shares the bound onJbetween threads.Not changed: the continuous solver
daqp_ldp(no binaries) still compares2*fval_boundwith the internal objective withoutc.Tests
interfaces/daqp-eigen/tests/32_bnb_regressions.cpp, one case per defect.dyadwithout this change: cases 2 and 3 fail, and case 1 aborts under AddressSanitizer.Host: demeter2, session
session_01JGy8Ya4ZvmiQUA33aivGGJ, working directory/tmp/daqpfork🤖 Generated with Claude Code