foundations of constraint processing csce421/821, fall 2004:

24
October 3, 2004 Interchangeability in CSP s 1 Foundations of Constraint Processing, Fall 2004 Foundations of Constraint Processing CSCE421/821, Fall 2004: www.cse.unl.edu/~choueiry/F04-421-821/ Anagh Lal Avery Hall, Room 123D [email protected] Interchangeability in CSPs

Upload: moana

Post on 12-Jan-2016

26 views

Category:

Documents


0 download

DESCRIPTION

Interchangeability in CSPs. Foundations of Constraint Processing CSCE421/821, Fall 2004: www.cse.unl.edu/~choueiry/F04-421-821/ Anagh Lal Avery Hall, Room 123D [email protected]. Outline. Exploiting problem structure Interchangeability: Introduction Interchangeability: Types - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 1

Foundations of Constraint Processing, Fall 2004

Foundations of Constraint Processing

CSCE421/821, Fall 2004:

www.cse.unl.edu/~choueiry/F04-421-821/

Anagh LalAvery Hall, Room 123D

[email protected]

Interchangeability in CSPs

Page 2: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 2

Foundations of Constraint Processing, Fall 2004

Outline

• Exploiting problem structure

• Interchangeability: Introduction

• Interchangeability: Types

• Search with Interchangeability

• Non-binary CSPs: Challenges and approach

• Databases: Challenges and approach

Page 3: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 3

Foundations of Constraint Processing, Fall 2004

Exploit problem structure

• Declared symmetries [Glaisher 1874; Ellman 1993]

– Applies to specific class of problems– Requires that a user or designer know the

structure of the problem

• Discover symmetries– Solver discovers symmetries called

interchangeability– Symmetry detection partitions the domain of

variables

Page 4: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 4

Foundations of Constraint Processing, Fall 2004

Idea

V3

{c, d, e, f }{d}

{a, b, d} {a, b, c}

V4

V2V1

Consider V2

Domain value

Consistent with

c V3(a, b, d)

V4(a, b)

d V3(a, b)

V4(a, b, c)

e,f V3(a, b, d)

V4(a, b, d)

Page 5: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 5

Foundations of Constraint Processing, Fall 2004

Interchangeability: Basics• Two interchangeable values of a variable

behave in the same way– Globally (likely intractable) or– Locally (tractable)

• Interchangeable values are redundant• Interchangeable values can be placed in a

bundle and treated as a single value

{ c d e, f }V2

Page 6: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 6

Foundations of Constraint Processing, Fall 2004

Advantages

• Cluster or club together values e and f to form a bundle.

• Search effort reduces– Fewer nodes are visited

• Solutions produced may represent more than one solution– Solution space is compacted.

c e, f d

dV1

V2

S

c e f d

dV1

V2

S

Page 7: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 7

Foundations of Constraint Processing, Fall 2004

Full Interchangeability• Full Interchangeability (FI)

– All constraints constraints are considered• Even when they do not apply to the variable

– Two values of a variable are Full Interchangeable if on replacing one with the other gives another solution

– Computing FI requires finding all solutions

V3

{c, d, e, f }{d}

{a, b, d} {a, b, c}

V4

V2V1

Page 8: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 8

Foundations of Constraint Processing, Fall 2004

Neighborhood Interchangeability

• Restricted to neighborhood of a variable

• Easier to compute NI than FI

• Compute bundles and store for use during search

V3

{c, d, e, f }{d}

{a, b, d} {a, b, c}

V4

V2V1

Page 9: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 9

Foundations of Constraint Processing, Fall 2004

Computing NI

• Discrimination Tree (DT)– Data structure for

computing bundles of a variable.

• Only the constraints that apply to the variable are considered

• Requires an ordering of values to be followed

Page 10: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 10

Foundations of Constraint Processing, Fall 2004

Building the DT

• Let us work with an example on the board.

Page 11: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 11

Foundations of Constraint Processing, Fall 2004

Static versus Dynamic NI

• Static: Bundles computed prior to search

• Dynamic: Bundles computed during search

S

c d, e, f

dV1

V2

Dynamic bundlingStatic bundling

c e, f d

dV1

V2

S

c e f d

dV1

V2

S

Page 12: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 12

Foundations of Constraint Processing, Fall 2004

Finding all solutions

• Dynamic bundling has strong results– Guaranteed no more expensive than forward

checking– Guaranteed no more expensive than static

bundling– Guaranteed to produce larger bundles than

static bundling

Page 13: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 13

Foundations of Constraint Processing, Fall 2004

Finding one solution

• Traditionally dynamic bundling was thought to be an overkill for finding one solution

• Theoretical claims can not be made

• Show empirically that dynamic bundling is effective for finding one solution also

Page 14: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 14

Foundations of Constraint Processing, Fall 2004

Extending to non-binary• Now we start getting into my work, finally!• Non-binary CSP: CSP with at least one

constraint of arity greater than 2.• Many problems modeled more naturally by

non-binary constraints– Theoretically all non-binary CSPs can be

decomposed to binary– Binary version may not be a good choice all

the time

Page 15: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 15

Foundations of Constraint Processing, Fall 2004

Non-binary CSPs

• Informal introduction

• Representation

C4

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

{1, 2, 3}

{1, 2, 3}

{1, 2, 3}

{1, 2, 3}

C2

C1

C3

ConstraintVariable

Page 16: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 16

Foundations of Constraint Processing, Fall 2004

The Challenges

• Constraints of different arities cause problems– Not possible to make one composite DT like

structure– Comparing different length tuples (set of

variable-value pairs) is awkward

• Handling “Partially instantiated” constraints

Page 17: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 17

Foundations of Constraint Processing, Fall 2004

Bundling non-binary CSPs

• Data structure used: non-binary Discrimination Tree (DT)

• For bundling nb-CSP variables– Create a non-binary DT for each constraint

that applies to the variable• Note difference from binary: All constraints were in

one DT

– Intersect the bundles from all the nb-DTs to get the bundles

Page 18: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 18

Foundations of Constraint Processing, Fall 2004

The reason behind the gains• A no-good is a partial

instantiation that does not lead to a solution

• When search with bundling BTs on a no good a larger search space is eliminated

• Of course, the same logic applies to a solution bundle

{1, 2}

{3}

{3}

{1, 2}

{1, 3} {3}

{3} {3}

No-good bundle

V

D

C

A

B

Solution bundle

Page 19: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 19

Foundations of Constraint Processing, Fall 2004

Some results

0

200

400

600

800

1000

1200

0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7

# NV in DynBndl# NV in FCFirst Bundle Size

First Bundle Size

Tightness

n = 20, a = 10 p2 = 0.25

c3 = 3 c4 = 2

Page 20: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 20

Foundations of Constraint Processing, Fall 2004

Some results [2]

0

500

1000

1500

2000

0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7

DynBndlFC

n = 20, a = 10 p2 = 0.25

c3 = 3 c4 = 2

Tightness

Overhead due to large FBS (upto 1200) at low tightness

Maximum gains occur around phase-transition area

CP

U t

ime

[ms]

Page 21: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 21

Foundations of Constraint Processing, Fall 2004

Moving on to databases

• Observations– The gains due to dynamic bundling are more

for larger domain sizes– For finding all solutions bundling is always

better– Bundling produces compact solution spaces

• Deduction– Lets try it in Databases

Page 22: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 22

Foundations of Constraint Processing, Fall 2004

Database facts & challenges• Database is about I/O, CPU comparisons

don’t matter• Data does not fit in memory• Memory efficiency is key to database

algorithms• Database query processing algorithms

provide an iterator interface to the query engine

• Dynamic bundling as is, does not fit!!

Page 23: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 23

Foundations of Constraint Processing, Fall 2004

How did we handle it for DB

• A new bundling algorithm– No DTs– Sort constraints (the tables of the DB), use the

structure introduced by sorting to detect bundles

• Model search with bundling to fit the framework of query processing algorithms (join algorithm, in particular)

Page 24: Foundations of Constraint Processing CSCE421/821, Fall 2004:

October 3, 2004 Interchangeability in CSPs 24

Foundations of Constraint Processing, Fall 2004

Partition

Unequalpartitions

Symmetricpartitions

Bundle {1, 5}

R1

A B C

1 12 23

1 13 23

1 14 23

2 10 25

5 12 23

5 13 23

5 14 23

Current bundleof

R1.A = {1, 5}

Computing a bundle of R1.A