UFLP_test

Module summary

Tests the UFLP-related machinery (UFLP_2_cav and UFL).

Note

The module requires Gurobi solver.

(In the implementation details below, click on class/function names for additional documentation and links to the source code.)

❖❖❖

Implements functions (outside the classes above):

gen_UFL_instance(n, m)

Generates a test facility location instance.

test_DPs(test_inst)

Tests the DP-inspired diagrams.

test_MIPs(test_inst)

Tests that MIPs return the same objectives.

test_cluster_reverse_custom(param)

Tests the jUFLP-instance-generation procedure (for the given number of inversions).

❖❖❖

Implementation details

❖❖❖

Functions

UFLP_test.gen_UFL_instance(n, m)[source]

Generates a test facility location instance.

Parameters
  • n (int) – number of facilities

  • m (int) – number of customers

Returns

A tuple with the following values.

  • S (list): neighborhood list

  • f (dict): costs of facility location (generated uniformly random int from f_min to f_max)

  • g (dict): overlap costs, keys: (customer, overlap)

UFLP_test.test_DPs(test_inst)[source]

Tests the DP-inspired diagrams.

UFLP_test.test_MIPs(test_inst)[source]

Tests that MIPs return the same objectives.

UFLP_test.test_cluster_reverse_custom(param)[source]

Tests the jUFLP-instance-generation procedure (for the given number of inversions).