Loading in 5 sec....

Specialised (user defined) constraints in JChocoPowerPoint Presentation

Specialised (user defined) constraints in JChoco

- By
**dian** - Follow User

- 72 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about ' Specialised (user defined) constraints in JChoco' - dian

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### Specialised (user defined) constraints in JChoco

2 examples: max and subtour elimination

Consider the following contraint

This can be implemented in JChoco using primitives as follows

Could I define my own constraint to do this?

Why would I want to do that?

- Possibly:
- more compact
- faster
- more propagation

V[0] = max(v[1],v[2],…,v[n-1])

Define a constraint called Max that extends AbstractLargeIntConstraint

V[0] = max(v[1],v[2],…,v[n-1])

initiation

inf: lower bound

sup: upper bound

removal of value

instantiate

V[0] = max(v[1],v[2],…,v[n-1])

Note: output always has a 4 or a 5 in it

An array of n variables

- “single successor” model of a graph
- Limits what kind of graph can be modelled
- out-degree of 1

But this aint enough

Associate with each variable next[i] the following reversible variables

- When making an instantiation
- next[i] = j
- We now join the path that ends in i to path that starts with j
- If the path involves less that n vertices/cities
- next[e[j]] != s[i]
- i.e. we cannot close that loop!

s[6] = 8

8

e[8] = 6

s[7] = 0

7

4

5

next[7] ≠ 0

Otherwise we have a subtour/loop

This is the “propagation” .

1

2

3

0

e[0] = 7

Note: this is a constraint that may be used in a richer problem

A knights-graph with a degree sequence 2* that is connected

i.e. adjacency matrix model of the graph

- Jean-Francois Puget called this “the glass box”
- Note how this fits with AC5
- Note that we need to consider state and backtracking
- Why bother?

Download Presentation

Connecting to Server..