UFLP_fullDD
Module summary
Solves UFLP using a DD-based approach.
The core function, create_cover_DD()
, implements
the BDD-building procedure to encode a j-UFLP sub-instance
(i.e., a UFLP problem with overlap costs).
Related: a good order of variables is found with UFLPOrder
module.
(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):
|
Helper: calculates the added cost during the BDD creation. |
|
Generates a BDD for an UFLP with cavemen structure. |
|
Helper: formats a node label according to the |
Creates a diagram for a simple UFLP instance. |
|
Tests |
|
|
Tests the full-DD-based approach against a MiP. |
❖❖❖
Implementation details
❖❖❖
Functions
- UFLP_fullDD.calc_cost(pts_list, state, prev_state, last_decision, S, f, c)[source]
Helper: calculates the added cost during the BDD creation.
- Parameters
S – UFLP instance parameters,
f – UFLP instance parameters,
c – UFLP instance parameters,
pts_list (list) – points to generate cost for,
state – the new state
last_decision (tuple) – a var (int) - value(int) pair.
- Returns
Added cost according to the
state
.
- UFLP_fullDD.create_cover_DD(S, f, c, node_order)[source]
Generates a BDD for an UFLP with cavemen structure.
- Parameters
S – instance params (see
darkcloud.gen_caveman_inst()
),f – instance params (see
darkcloud.gen_caveman_inst()
),c – instance params (see
darkcloud.gen_caveman_inst()
),node_order (list[int]) – order of nodes to add.
- Returns
resulting diagram
- Return type
B (class BDD)
Note
Implements ‘forgetting’ nodes along the way.
- UFLP_fullDD.test_cost_calc()[source]
Tests
UFLP_fullDD.calc_cost()
function.