![](bg3.png)
real life problem instance. inst(ec
r
,H
r
) consists of
289’200 control variables, 411’838 linear non-unary
constraints and 490’560 nonlinear constraints for the
H
r
= 8
′
760. Under the confidentiality agreement we
are not allowed to disclose the structure of ec
r
. For the
time cr(st) used to perform the optimization, the con-
dition cr(st) > 10min is called the timeout. ¬timeout
is a requirement for the solver.
We have used the following criteria to compare
models: cr(nlin) are nonlinearities included in the
model, cr(gopt) is guarantee of optimality provided,
cr(long) are long period constraints included in the
model, cr(tef f ) = cr(st)/H time efficiency. The ap-
proaches have been tested on personal computers with
2 x 2.2Ghz processors, 3GB of RAM and address
space.
3.1 Constraint (Logic) Programming
Constraint programming (CP) (Apt, 2009; Marriott
and Stuckey, 1998) is a programming paradigm with
the central notion of a constraint. A constraint states
relations between variable domains (allowed combi-
nations of domain values). CP is a form of declara-
tive programming where the program in the form of
constraint statements is a description of the problem,
rather than a path to the solution (unlike in the case
of procedural programming). CP makes a distinction
between 3 components required to obtain a solution:
the declarative constraint statement, constraint prop-
agation and search. Historically CP has grown out of,
and has been embedded in logic programming and of-
ten uses the LP based backtracking search, it is how-
ever possible to embed constraint programming in a
procedural language.
We have tested models written under two CP
systems (Schulte, 2010; Szymanek and Kuchci´nski,
2010) and a CLP system (Cisco Systems, 2010) with
the result of obtaining optimal solutions for problem
instances with H ∈ [1,⌊H
r
/2000⌋]. The cr(tef f) ∈
[5s,25s] depending on the CP system, constraint prop-
agation methods and search methods. However for
problem instances with H ≥ ⌊H
r
/100⌋ we have been
unable to produce a solution without a timeout.
The advantages of the CP approach are that the
complete problem model can be taken into account
cr(long) = cr(nlin) = true, solution with the guar-
antee of optimality can be obtained cr(gopt) = true.
The major disadvantage is that the models are imprac-
tical for problem instances near the real life problem
size
3.2 Dynamic Programming
Dynamic programming (DP) (Bellman, 1953; Cor-
men et al., 2001) is a mathematical and computer al-
gorithmic scheme for solving optimization problems.
The method builds the final solution by expanding ini-
tial conditions step by step into more complex cases
with cr(tef f) determined by the number of states and
the complexity of the step.
By means of DP it is possible to obtain a com-
plete solution with cr(gopt) = true in polynomial
time complexity by (i) calculating an initial solution
for h = 1 and pu
1
1
and (ii) expanding the solution upon
all of the pu and year. Unfortunately, the complexity
of our problem generates a state-space too large for
any direct approach. However, a combined approach
of DP and local search can be derived if only we are
able to separate a simple subproblems for DP.
We have used a DP approach to determine, for a
fixed hour h, the costs of volumes vol
s
h
∈
∑
i
v(pu
s
i
,h)
for all ps
s
∈ {ps
s
} and generate the maximized to-
tal profit pr
h
for hour h. In the basic version we
have determined pr
h
by managing costs of produc-
tion of each pu
s
i
. These costs included the joint
costs of maintaining the pu
s
i
on vol
s
i,h
along with a
few other parameters (e.g. profit and cost associated
with be
b
production). In the first step of the algo-
rithm we have generated a lookup table of production
volumes vol
s
h
and minimal costs of achieving them
for each ps
s
. Assume that, for a fixed h and ps
s
,
v(pu
s
i
,h) ∈ [mn
i
,mx
i
]. We denote the cost of pu
s
i
in
h with volume x ∈ [mn
i
,mx
i
] as ep(i,x). Let m[x][z],
where x ∈ [1,U
s
] and z ∈ [
∑
U
s
i=1
mn
i
,
∑
U
s
i=1
mx
i
] be an
optimal cost of the production units (pu
s
1
− pu
s
x
) gen-
erating a total production equal to z. The values of
m[x][z] are equal to: (i) cp(1,z) for z ∈ [mn
1
,mx
1
], (ii)
min(m[x−1][z− i] + cp(x,i)) for i ∈ [mn
i
,mx
i
] or (iii)
∞ in all remaining cases. This relation gave us, for
each h and ps
s
, an optimal configuration of vol
s
i,h
nec-
essary to produce vol
s
h
. In the second step we merged
all obtained lookup tables (using DP) along with pur-
chases ze
i
modeled as an artificial pu with its own
lookup table. In the following step we generated (us-
ing DP once again) a lookup table for hour h and for
sales se
i
, containing the optimal methods of selling
of particular en volumes. In the last step of the al-
gorithm we have compared the two obtained lookup
tables and greedily chosen the best vol
h
as the pro-
duction volume of the ec.
The basic DP algorithm described above was fast
(cr(tef f ) = 5 − 8ms) comparing to CP but did not
include cr(long) leading to a very complicated local
search with poor final result for the year. Thus, we
have refined the solution by introducing partial op-
ICEIS2012-14thInternationalConferenceonEnterpriseInformationSystems
280