You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add plan for #399: MinSumMulticenter model
* Implement MinSumMulticenter (p-median) model (#399)
Add the MinSumMulticenter problem — a facility location optimization
problem that minimizes total weighted distance from vertices to K
selected centers. Includes graph + vertex weights + edge lengths input,
Bellman-Ford shortest path computation, CLI support, and comprehensive
unit tests (19 tests including solver, serialization, edge cases).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove plan file after implementation
* Address Copilot review comments for MinSumMulticenter
- Fix docstring: "multi-source Dijkstra" → "multi-source Bellman-Ford"
- Add iteration cap (n-1) to prevent non-termination with negative edges
- Fix potential borrow issue: clone du instead of dereferencing
- Add MCP tools support (create_problem_inner + create_random_inner)
- Regenerate problem_schemas.json to include MinSumMulticenter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Rename MinSumMulticenter to MinimumSumMulticenter
Per issue #399 and human review comment, the naming convention
requires the full "Minimum" prefix (matching MinimumVertexCover,
MinimumDominatingSet, etc.). Rename struct, files, module paths,
CLI aliases, and regenerate schemas.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add MinimumSumMulticenter paper section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix trait consistency, switch to Dijkstra for MinimumSumMulticenter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: GiggleLiu <cacate0129@gmail.com>
Given a graph $G = (V, E)$ with vertex weights $w: V -> ZZ_(>= 0)$, edge lengths $l: E -> ZZ_(>= 0)$, and a positive integer $K <= |V|$, find a set $P subset.eq V$ of $K$ vertices (centers) that minimizes the total weighted distance $sum_(v in V) w(v) dot d(v, P)$, where $d(v, P) = min_(p in P) d(v, p)$ is the shortest-path distance from $v$ to the nearest center in $P$.
581
+
][
582
+
Also known as the _p-median problem_. This is a classical NP-complete facility location problem from Garey & Johnson (A2 ND51). The goal is to optimally place $K$ service centers (e.g., warehouses, hospitals) to minimize total service cost. NP-completeness was established by Kariv and Hakimi (1979) via transformation from Dominating Set. The problem remains NP-complete even with unit weights and unit edge lengths, but is solvable in polynomial time for fixed $K$ or when $G$ is a tree.
583
+
584
+
The best known exact algorithm runs in $O^*(2^n)$ time by brute-force enumeration of all $binom(n, K)$ vertex subsets. Constant-factor approximation algorithms exist: Charikar et al. (1999) gave the first constant-factor result, and the best known ratio is $(2 + epsilon)$ by Cohen-Addad et al. (STOC 2022).
585
+
586
+
Variables: $n = |V|$ binary variables, one per vertex. $x_v = 1$ if vertex $v$ is selected as a center. A configuration is valid when exactly $K$ centers are selected and all vertices are reachable from at least one center.
0 commit comments