Specialised user defined constraints in JChoco - PowerPoint PPT Presentation

About This Presentation
Title:

Specialised user defined constraints in JChoco

Description:

Define a constraint called Max that extends AbstractLargeIntConstraint ... But this aint enough 'single successor' model of a graph ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 59
Provided by: Pat376
Category:

less

Transcript and Presenter's Notes

Title: Specialised user defined constraints in JChoco


1
Specialised (user defined) constraints in JChoco
2 examples max and subtour elimination
2
Consider the following contraint
This can be implemented in JChoco using
primitives as follows
3
Due to Chris Unsworth
4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
Could I define my own constraint to do
this? Why would I want to do that?
  • Possibly
  • more compact
  • faster
  • more propagation

8
V0 max(v1,v2,,vn-1)
Define a constraint called Max that extends
AbstractLargeIntConstraint
9
(No Transcript)
10
(No Transcript)
11
(No Transcript)
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
Methods to be implemented
V0 max(v1,v2,,vn-1)
initiation
inf lower bound sup upper bound
removal of value
instantiate
16
V0 max(v1,v2,,vn-1)
A demo
Cart before the horse?
17
V0 max(v1,v2,,vn-1)
Note output always has a 4 or a 5 in it
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
21
We havent used them yet, but .
Backtrackable Variables (Stored)
22
(No Transcript)
23
(No Transcript)
24
(No Transcript)
25
(No Transcript)
26
Small TSPs
27
(No Transcript)
28
The single successor model
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
29
The single successor model
NOT A TOUR!
1
2
3
0
5
6
7
4
7
4
5
6
0
1
2
3
We need subtour elimination
30
(No Transcript)
31
Associate with each variable nexti the
following reversible variables
  • When making an instantiation
  • nexti 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
  • nextej ! si
  • i.e. we cannot close that loop!

32
6
s6 8
8
e8 6
s7 5
7
4
5
next1 5
e5 7
1
s1 0
2
3
0
e0 1
33
6
s6 8
8
e8 6
s7 0
7
4
5
1
2
3
0
e0 7
34
6
s6 8
8
e8 6
s7 0
7
4
5
next7 ? 0 Otherwise we have a
subtour/loop This is the propagation .
1
2
3
0
e0 7
Note this is a constraint that may be used in a
richer problem
35
(No Transcript)
36
(No Transcript)
37
Example application knights tour
38
(No Transcript)
39
(No Transcript)
40
(No Transcript)
41
(No Transcript)
42
Wot! Show me a picture!
43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
(No Transcript)
47
(No Transcript)
48
Is there a dvo heuristic for this?
49
(No Transcript)
50
(No Transcript)
51
(No Transcript)
52
(No Transcript)
53
Warnsdorff's rule
54
Is there an alternative model for this?
55
A knights-graph with a degree sequence 2 that is
connected i.e. adjacency matrix model of the
graph
56
So?
  • 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?

57
(No Transcript)
58
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com