3
votes
Turning K-Medoids into an optimization problem
Yes, the problem can be solved exactly using common IP algorithms such as branch-and-cut, with the usual qualification that there will be some limit on the size of the problems you can handle. (What ...
3
votes
Grouping values based on a difference constraint
Since you've a threshold (diff) you may pre-define max of diff number of groups, not the full length of the list.
As for the if condition try this
$L(x_{i,g}+x_{j,g}-1) \le d - (L_j - L_i)$
where $L$ ...
3
votes
Grouping values based on a difference constraint
Some of this may be solver dependent. I just ran your model with only one change -- switching the solver from glpk to CPLEX -- and got a valid solution (the same as yours, changing group 10 to group 2)...
1
vote
Turning K-Medoids into an optimization problem
sure, K-medoids could be expressed as an optimization problem, I recommend you read the paper: Clustering by a means of medoids, Leonard kaufman, peter rousseeuw
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
clustering × 24optimization × 11
graphs × 6
mixed-integer-programming × 5
linear-programming × 3
vehicle-routing × 3
modeling × 2
python × 2
reference-request × 2
combinatorial-optimization × 2
nonlinear-programming × 2
network-flow × 2
heuristics × 2
r × 2
cplex × 1
constraint × 1
linearization × 1
convex-optimization × 1
computational-complexity × 1
big-m × 1
facility-location × 1
java × 1
machine-learning × 1
data × 1
supply-chain × 1