transforming and refining abstract constraint specifications alan frisch, brahim hnich*, ian miguel,...

27
Transforming and Refining Abstract Constraint Specifications Alan Frisch, Brahim Hnich*, Ian Miguel, Barbara Smith, and Toby Walsh *Cork Constraint Computation Center Supported by SFI

Post on 19-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Transforming and Refining Abstract Constraint

Specifications

Alan Frisch, Brahim Hnich*, Ian Miguel, Barbara Smith, and Toby

Walsh *Cork Constraint Computation

Center

Supported by SFI

The Art of ModellingInformal description

Modelling

Formal description

Modelling: mental processModelling: Informal Formal

Modelling: conceptual gapInformal description

Modelling

Formal description

Conceptual gap between the informaldescription of the problem and the formal one

“Easier” Modelling

Informal description

Modelling

Formal description

Reducing the conceptual gap makesmodelling easier

In this talk…

Informal description

Formal description

Combinatorial Optimisation Problems

Constraint Satisfaction Problems

In this talkInformal description

Modelling

Formal description

New conceptual gap

Automatic Translation

Abstract FormalSpecification

•Intermediate models are easier to develop, understand, and maintain•Automatically generated models are “efficient” (compared to what humans can produce)

Formal descriptionFormal description

Multiple levels of abstractions, transformations, and refinements

Informal problem descriptions

Abstract specification

CSPs

Conceptual gapreduced Easier modelling

Automatic generationof alternate CP models through refinement

Transformation

Transformation

SONET problem

Abstract Specification

Refinement

Abstract Specification+

Implied Constraintss

CP model 4CP model 3CP model 2CP model 1

Transformation

Informal SpecificationModelling

The SONET probelm

Informal description: In a communications network, there are client nodes and known levels of

demand between pairs of nodes. However, traffic can only be routed between pairs of distinct nodes if they are installed on the same SONET ring.

A node is installed on a SONET ring via a dedicated add-drop multiplexer (ADM). Each node may be installed on multiple rings and demand between a pair of nodes may be split over several rings.

The maximum number of rings available is known. Each ring has a capacity in terms of the volume of traffic and the number

of nodes that can be installed on it.

The objective is to minimise the number of ADMs used.

SONET problem: an instance

2

54

3

1

22

11

1

3

Given 5 nodes, 3 rings Each ring has a node capacity of 4 Each ring has a traffic capacity of 6And the following demand graph

An optimal solution

1

2

4

3

5

3

32 2

1

1

Ring1 Ring2 Ring3

An optimal solution(Simplified)

1

2

4

3

5

3

Ring 1 Ring 2 Ring 3

In this talk we ignore the demand levels

An abstract model

1

2

3

4

5

1

2

3

The set of nodes The set of rings

An abstract model: relation variable

In this talk we ignore the demand levels

1

2

3

4

5

1

2

3

The set of nodes The set of ringsVar R: x

An abstract model: Objective funtion

The set of nodes The set of rings

12345

123

Var R: x

Minimize the cardinality of R //minimizes the number of ADMs

An abstract model: capacity constraint

The set of nodes The set of rings

12345

123

Var R: x

Minimize the cardinality of R //minimizes the number of ADM

For all r in rings. Cardinality of R-1(r) is less than or equal to capacity

R-1(1)={1,2,3,4}

An abstract model: communication constraint

The set of nodes The set of rings

12345

123

Var R: x

Minimize the cardinality of R //minimizes the number of ADM

For all r in rings. Cardinality of R-1(r) is less than or equal to capacity

For every pair node1 and node2 in the demand graph.

R(node1) ∩ R(node2) ≠Ø

R(3) ={1,2}

Transformation

Starting from the abstract model, we derive 4 implied constraints• IC1: imposes a lower bound on the number of ADMs

• IC2: imposes a lower bound on the number of open rings

• IC3: a node is installed in a ring only if it communicate with another node in the same ring

• IC4: the sum of capacities of any two non-empty rings exceeds the capacity of an individual ring

• ..details in the paper

Transformation

Starting from the abstract specification, we derive 4 implied constraints• Problem-class transformation

• Work for all instances

• Keeps the model at the same level of abstraction

Refinement

Refinement transforms an abstract model into a model at a lower level of abstraction

Two main decisions• How to represent abstract variables?

• How to translate the constraints?

Optional tasks• How to break symmetry, if it exists?

Non-deterministic: a one-to-many mapping

Representing relation variable

12345

123

AB

1 1 1 1 0

0 0 1 0 1

0 0 0 0 0

1 2 3 4 5

123

A 2d Boolean matrix M indexed by A and B

<a,b> in R iff M[a,b]=1

Representing relation variable

12345

123

AB

{1} {1} {1,2} {1} {2}

1 2 3 4 5

A 1d matrix M indexed by A of set variables that are subsets of B

<a,b> in R iff b in M[a]

Representing relation variable

12345

123

AB

{1,2,3,4} {3,5} {}

1 2 3

A 1d matrix M indexed by B of set variables that are subsets of A

<a,b> in R iff a in M[b]

Representing relation variable

12345

123

AB

{1,2,3,4} {3,5} {}

1 2 3

A 1d matrix M1 indexed by B of set variables that are subsets of A

<a,b> in R iff a in M[b]

{1} {1} {1,2} {1} {2}

1 2 3 4 5

A 1d matrix M2 indexed by A of set variables that are subsets of B

<a,b> in R iff b in M[a]

a in M1[b] iff b in M2[a]

Translating constraints

Constraints are rewritten based on the choice of representation

• E.g.

• …details are in the paper

Minimize the cardinality of R

Minimize the entries of the Boolean matrix

Breaking symmetry

When we represent a relation variable as a 2d matrix for instance• Pitfall: row and column symmetry introduced

Can be detected while refining the abstract model• Add symmetry breaking constraints to the

refined model

Multiple levels of abstractions, transformations, and refinements

Informal problem descriptions

Abstract specification

CSPs

Conceptual gapreduced Easier modelling

Automatic generationof alternate CP models through refinement

Transformation

Transformation