pykp.metrics#

Metrics for evaluating knapsack instance complexity.

PyKP metrics provides metrics to evaluate the complexity of knapsack problem instances.

Metrics#

phase_transition(num_items[, samples, ...])

Compute the phase transition matrix for knapsack instances.

sahni_k(arrangement, capacity)

Compute the Sahni-k metric for a given knapsack arrangement.

fsr(instance)

Compute the feasibility ratio for a given knapsack problem.

fbp(instance)

Compute the feasibility boundary proportion for a knapsack problem.