Many optimization problems can be naturally represented as (hyper) graphs,
where vertices correspond to variables and edges to tasks, whose cost depends
on the values of the adjacent variables. Capitalizing on the structure of the
graph, suitable dynamic programming strategies can select certain orders of
evaluation of the variables which guarantee to reach both an optimal solution
and a minimal size of the tables computed in the optimization process. In this
paper we introduce a simple algebraic specification with parallel composition
and restriction whose terms up to structural axioms are the graphs mentioned
above. In addition, free (unrestricted) vertices are labelled with variables,
and the specification includes operations of name permutation with finite
support. We show a correspondence between the well-known tree decompositions of
graphs and our terms. If an axiom of scope extension is dropped, several
(hierarchical) terms actually correspond to the same graph. A suitable
graphical structure can be found, corresponding to every hierarchical term.
Evaluating such a graphical structure in some target algebra yields a dynamic
programming strategy. If the target algebra satisfies the scope extension
axiom, then the result does not depend on the particular structure, but only on
the original graph. We apply our approach to the parking optimization problem
developed in the ASCENS e-mobility case study, in collaboration with
Volkswagen. Dynamic programming evaluations are particularly interesting for
autonomic systems, where actual behavior often consists of propagating local
knowledge to obtain global knowledge and getting it back for local decisions.