CSP 101, Overview: advanced solving techniques and

Constraint Satisfaction 101
Foundations of Constraint Processing
CSCE421/821, Spring 2011
www.cse.unl.edu/~choueiry/S11-421-821/
All questions to [email protected]
Berthe Y. Choueiry (Shu-we-ri)
Avery Hall, Room 360
[email protected]
Tel: +1(402)472-5444
Foundations of Constraint Processing
CSP 101: continued
1
Outline
Motivating example, application areas
CSP: Definition, representation
Some simple modeling examples
More on definition and formal characterization
Basic solving techniques
Implementing backtrack search
 Advanced solving techniques
 Issues & research directions
 CSP in a nutshell
 Constraint Logic Programming (quickly)
Foundations of Constraint Processing
CSP 101: continued
2
Outline
Advanced solving techniques
Decomposition
Deep analysis (islands of tractability)
Distributed CSPs
Issues & research directions
CSP in a nutshell
Constraint Logic Programming (quickly)
Foundations of Constraint Processing
CSP 101: continued
3
Decomposition
[Freuder & Hubbe, CP 93]
Conjunctive
Disjunctive
• Decomposition
V1
V1
• Conjunctive
{ a, b, c, ...}
{ a, b, c, ...}
V2 { m, n, o, p}
V5
V2 { m, n, o, p}
V5
{ a, b, c, d}
{ a, b, c, d}
V4
V4
{ .., .., .., ..}
{ .., .., .., ..}
V3
V6
{ .., .., .., ..}
{ .., .., .., ..}
V3
{ .., .., .., ..}
{ .., .., .., ..}
{ .., .., .., ..}
{ .., .., .., ..}
V7
V1
V7
{ a, b, c, ...}
V5
V2 { m, n, o, p}
• Disjunctive
V6
{ a, b, c, d}
V4
{ .., .., .., ..}
V3
{ .., .., .., ..}
V6
{ .., .., .., ..}
{ .., .., .., ..}
V7
V1
V1
{ a, b }
V2
V5
{ m, p }
V4
V6
V3
{ .., .. }
V3
{ .., .. }
V7
{ a, c, d}
V4
{ .., .., .. }
{ .., .. }
V5
V2 { n, o}
{ a, c }
{ .., .., .. }
{b, c, ..}
{ .. }
V6
{ .., .. }
{ .., .. }
Foundations of Constraint Processing
CSP 101: continued
4
Properties of decompositions
P  {P1 , P2 , , Pi }
• Conjunctive or disjunctive?
•
•
•
•
•
•
Consistent:
Simplifying:
Semi-complete:
Complete:
Redundant:
Reducible:
No constraint is removed
Size(Pi) < Size( P)
At least one solution is kept
No solution is lost
Solutions replicated in { Pi}
may be < Size( P)
Foundations of Constraint Processing
CSP 101: continued
5
Deep analysis
Uncover particular properties, e.g.
– bound the required level of consistency (islands of tractability)
– predict ease/difficulty of solving a given instance
• Structure, topology of the constraint graph
– tree, DAGs, chordal, bounded-width/induced width, k-trees, etc.
• Types, semantics of the constraints
– linear inequalities, subsets of Allen's relations, functional,
monotonic, row-convex, all-diffs, etc.
• Order parameter (phase transition)
Foundations of Constraint Processing
CSP 101: continued
6
Cost of solving
Phase transition
Mostly solvable
problems
[Cheeseman et al. ‘91]
Mostly un-solvable
problems
Critical value of
order parameter
Order parameter
• Significant increase of cost around critical value
• In CSPs, order parameter is constraint tightness & ratio
• Algorithms compared around phase transition
Foundations of Constraint Processing
CSP 101: continued
7
Distributed CSPs
• Mainly in search
– Asynchronous BT (e.g., work of Yokoo)
– Fine grain local search (ERA, by Liu)
– Privacy of constraints
• More purist multi-agent approaches
–
–
–
–
Applications: scheduling & resource allocation
Based on decomposition of problem/solvers
Emerging area: Social Choice (Voting, auctions)
Let’s take a wider perspective than what is done
today…
Foundations of Constraint Processing
CSP 101: continued
8
Multi-agent approach
1. Computational tasks:
problem decomposed, replicated
2. Types of agent:
broker, solver, problem, solver+problem
3. Architecture and authority:
hierarchical, egalitarian, priority-based (e.g., vote)
4. Nature of communication:
agent-to-agent, group, broadcast
5. Interaction strategies:
cooperating vs. competing
transparent vs. secretive
negotiation + alliance/coalition formation
Foundations of Constraint Processing
CSP 101: continued
9
Computational tasks
• At one end of the spectrum, agents may be involved in
solving heterogeneous, distinct and completely
independent problems and request other agents to
supply specific functionalities for the completion of the
individual tasks.
• At the other end of the spectrum, the same problem
could be replicated and assigned to all agents, which
can then share their individual results with other agents
incrementally in order to speed up the execution of the
global computational task.
Foundations of Constraint Processing
CSP 101: continued
10
Types of agents
An agent in the system can be any of the following:
• an agent that collects data from the environment and
formulates the CSP
• a reasoning module with specific computational
characteristics (e.g., various search algorithms)
• brokers that facilitate matching between a service seeker
and a number of service providers (e.g., CORBA
brokers).
Foundations of Constraint Processing
CSP 101: continued
11
Agent architecture..
.. and how authority is granted
• Agents could be organized in a strict hierarchy in which
a given agent has full control over the activities of the
agents that lie underneath it in the hierarchy. It decides
how the lower level agents may cooperate while
ensuring coordination with the higher-level agent.
• Agents could be in a strictly flat structure competing for
services and rewards, either chaotically or according
to some strict priority policy, for example, based on
voting or time-responsiveness.
Foundations of Constraint Processing
CSP 101: continued
12
Communication environment
Communications among agents may be
conducted according to:
• a one-to-one schema
• multi-cast (i.e., one-to-group),
• or broadcast, where all agents in the
environment have access to the content of
the communicated information.
Foundations of Constraint Processing
CSP 101: continued
13
Type of supported interactions
• Agents may be cooperative, pooling their resources and
capabilities to achieve a common, global objective, or
they could be competitive trying to win rewards and
optimize their individual gain.
• They could also adopt a midway strategy, dynamically
forming coalitions and gathering support to acquire
more resources and realize greater gains.
• Also, agents may be transparent about their intentions,
resources, needs, and constraints or may be secretive,
hiding one or the other of their strengths or weaknesses.
Foundations of Constraint Processing
CSP 101: continued
14
Outline
Advanced solving techniques
Issues & research directions
CSP in a nutshell
Constraint Logic Programming (quickly)
Foundations of Constraint Processing
CSP 101: continued
15
Research directions
• Preceding (i.e., search, backtrack, iterative repair, V/V/ordering,
consistency checking, decomposition, symmetries & interchangeability,
deep analysis)
• Evaluation of algorithms
– worst-case analysis vs. empirical studies
– random problems vs. real-world problems
• Cross-fertilization:
– DB, SAT & theoretical computer science (TCS), mathematical
programming, interval mathematics, logical inference, applications, etc.
• Modeling & Reformulation
• Extensions
– Non-binary, conditional, soft constraints & preferences, etc
• Multi agents
– Distribution and negotiation
– decomposition & alliance formation
Foundations of Constraint Processing
CSP 101: continued
16
Outline
Advanced solving techniques
Issues & research directions
CSP in a nutshell
Constraint Logic Programming (quickly)
Foundations of Constraint Processing
CSP 101: continued
17
CSP in a nutshell (I)
Definition: P = (V, D, C )
V  V1 ,V2 ,,Vn 
D  DV 1 , DV 2 ,, DV n 

C  C1 , C 2 ,, Cl
•
•
•
Constraint graph, constraint network
Finite domains
Binary constraints, universal constraints
V1
{ 1, 2, 3, 4 }
v1+v3 < 9
V3 { 3, 4, 9 }

v1 < v2
v2 < v3
{ 3, 6, 7 }
V2
v2 > v4
{ 3, 5, 7 }
V4
Examples: map coloring, puzzles, resource allocation, temporal
reasoning, product configuration, databases, spreadsheets,
graphical layouts, graphical user-interfaces, bioinformatics, etc.
Foundations of Constraint Processing
CSP 101: continued
18
CSP in a nutshell (II)
constructive
Solution technique: Search
Enhancing search:
iterative repair
Intelligent backtrack
Variable/value ordering
Constraint propagation
Hybrid search
 Symmetries
 Decomposition
Foundations of Constraint Processing
CSP 101: continued
19
CSP in a nutshell (III)
Deep analysis:
exploit problem structure
Tractability studies
 Graph topology
 Constraint semantics
Phase transition
Other
directions
-k-ary constraints (representation, efficient propagators)
- continuous vs. finite domains
- evaluation of algorithms (theoretical vs empirical)
- cross-fertilization (mathematical program.)
- preferences and soft constraints
 reformulation and approximation
 architectures (multi-agent, negotiation)
Foundations of Constraint Processing
CSP 101: continued
20
Outline
Advanced solving techniques
Issues & research directions
CSP in a nutshell
Constraint Logic Programming (quickly)
Foundations of Constraint Processing
CSP 101: continued
21
Constraint Logic Programming (CLP)
A merger of
 Constraint solving
 Logic Programming, mostly Horn clauses e.g., Prolog)
Building blocks
• Constraint: primitives but also user-defined
– cumulative/capacity (linear ineq), MUTEX, cycle, etc.
– domain: Booleans, natural/rational/real numbers, finite
• Rules (declarative): a statement is a conjunction of constraints and
is tested for satisfiability before execution proceeds further
• Mechanisms: satisfiability, entailment, delaying constraints
Foundations of Constraint Processing
CSP 101: continued
22