Interactive Constraint Propagation

Experience with
CP Products & Applications
Jacob Feldman, Ph.D.
[email protected]
732-662-7233 NJ office
732-306-0685 cell
Outline
Customer’s CP Applications
– Brief Review
– Two examples of workforce management apps
– From Batch to Interactive Engines
Interactive Constrained Environments
– Architecture
– Constrained GUI and Interactive Constraint Engine
– Practical Examples
2
Selected Customer’s Applications
IRS, Washington DC
 Strategic Workforce Planning: integrated use of constraint and linear
programming. The objective: maximize long-term revenue given an initial
workforce, potential workload, and expected budget.
Major Wall Street Institutions
 Decision engine for a wealth management system
 Minimization of Rules Violations
 Rule Processing System for large financial portfolios integrated with ILOG
CPLEX
Keyspan Energy, Long Island
 Interactive Scheduling engines for maintenance and construction jobs
FAA, Maryland
 Decision Support Tool for the Reduced Vertical Separation Minimum. RVSM
was intended to increase airspace capacity, improve aircraft operating
efficiency at the minimum cost. Developed a Logistic Simulator to monitor
airspace operations that allocated scarce resources to flights and airports in
a way to provide the required coverage of flights over a fixed period.
3
Selected Customer’s Applications (2)
Exigen Group
 Optimal selection of calling plans for telecom vertical solution
 Insurance underwriting
CPRail, Canada
 Grain Train Configuration and Scheduling
Sandia National Labs, New Mexico
 Supply Chain Scheduling for textile industry
FastMan (Ottawa) / Manugistics
 Manufacturing Scheduling Engine for a supply-chain software vendor
Solution Dynamics / I2 Technologies
 Optimal Container Loading for Warehouse management systems
CNN, Atlanta
 Advertisement/Show Scheduling
MCI, Colorado Springs
 Configuration and scheduling system for teleconferencing
Solution Dynamics, NJ
 Transportation routing with different business constraints to possible routes
4
IRS Strategic Compliance Planning Model
Internal Revenue Service (IRS): 150,000
people nationwide, virtually unlimited workload,
limited yearly budget. US Government wants to
make IRS more revenue-driven while satisfying
many other constraints and policies
The objective of the SCPM is to identify that
allocation of resources by location, position,
and grade for each year of a defined planning
period which will tend to maximize the
collection of taxes owed (including direct and
indirect revenues).
In two words: Reshape workforce to maximize
revenue over years
5
Generic Object Model
produce
s
Fire
consumes
WORKFORCE
CareerLadder,
TRANSITION
Transfer,
REVENUE
produce
s
TRANSACTIONS
Consumes
SELECT
WORKLOAD
BUNDLES
requires
produce
s
WORKFORCE
requires
consume
s
produce
s
BUDGET
consumes
HIRE
HIRE
TRANSACTIONS
WORKFORCE
requires
6
Examples of Constraints
Expected annual budgets
Allocation of funds to non-compliance
activities
IRS personnel rules and practices
Attrition
Minimum coverage
Minimum staff size (geographically
dependent)
“Front-loaded" funding
7
Examples of Constraints (2)
Geographic movement of employees
Transfer between positions (e.g., Revenue
Agent to Appeals)
Competitive promotions
Reductions in force
Annual comparability pay increase
Locality pay
Base salaries
Training requirements
8
Limitations
The amount of money available
– nationwide
– per location
The availability of work bundles
The direct time resources needed to
work each bundle
The time and expense required to
obtain needed skills
9
Workforce Measurements
Capacity: Hours / FTEs / Cost
Max Requirement: Hours / FTEs / Revenue
Min Requirement (to support min coverage)
After each Workload-Driven Engine Run:
– Workload Requirement:
• Required Hours / FTEs
• Produced Revenue
– Workforce Surplus: Hours / FTEs / Cost
10
Workload Measurements
For each year and total:
– Coverage Percent
– Total Yield
– Required Workforce Hours / FTEs /
Cost
– Produced Revenue based on actual
Y/toC
11
Transitions Between Positions and Grades
Engine generates “vertical” and “horizontal” transitions to
cover missing FTEs required by selected workload bundles
One more dimension: locations
P1
Time
P2
P3
P4
P5
G13
G12
G11
G9
12
SCPM Framework
Hybrid use of CP (Solver/Constrainer) and
LP (CPLEX/GLPK) for optimal
workload/workforce allocations
Interactive Workforce Modifications with
automatic constraint propagation
Using rule engine for workload forecasting
and generation
“Small” and “Big” engines working under
control of the same constraints
Live Demo
13
Scheduling and Resource Allocation for a Utility Company
LILCO – gas and electric utility
Batch constraint-based engine that allocates
resources (teams of specialists, equipment,
vehicles) to different field services jobs under
control of constraints/rules
– Initial success
– A practical need for constant customer interaction
– Scheduling Engine as a company employee that
constantly “learns and adjusts” to the real-world
situations
“Big” and “small” constraint engines working
under control of the same constraints
Live Demo
14
LILCO – Job View
15
LILCO – Resource View
16
CP Products
Horizontal CP Products
– ILOG Solver/Scheduler™ (used)
– Java Constrainer™ (developed, transferred to Exigen)
Vertical Products
– Utility Scheduler™ (developed)
 Resource Allocation & Scheduling engines for
service and utility jobs
– Load Optimizer (developed, transferred to I2)
 Truck loading software
17
Java Constrainer
Integer, Boolean, and Floating-point constrained variables
with very efficient domain implementations
All major Constraints and Constrained Expressions
Ability to handle Symbolic Expressions (!)
Generic reversible environment
Efficient event notification and constraint propagation
mechanisms
Predefined search Goals and Selectors
Ability to write problem specific constraints and search
algorithms
Basic scheduling classes (jobs, resources) and
constraints on them
18
Java Constrainer vs. C++ Solver:
Expressiveness
The same logical constraint in:
– ILOG C++ Solver:
• IlcIfThen(IlcAbs(x-5)>10, x*z<IlcPower(y,5))
– Pure Java Constrainer:
• x.sub(5).abs().more(10).imply((x.mul(z).less(y.power(5)))
– Java Constrainer with symbolic expressions:
• “|x-5|>10 -> x*z<y**5”
Samples with Sources
19
Java Constrainer vs. C++ Solver:
Efficiency
"100 queens": C++ = 0.12
Java = 0.13
"500 queens": C++ = 3.72
Java = 3.40
"1000 queens": C++ = 18.93 Java = 17.31
21
Interactive Constraint Satisfaction
Interactive Constrained Environments
– Architecture
– Problems
– Approaches
22
Interactive Problem Definition
A Quote from 1999 Constrainer’s Brochure:
“AI increasingly confronts real world
problems, in expert systems and robotics, for
example, we are increasingly likely to
encounter situations where, rather than
searching for a solution to a problem, we
must, in a sense, search for a problem we
can solve"
 Eugene C. Freuder. Partial Constraint
Satisfaction, 1996
Today interactive problem definition under
control of rules/constraints defined by
business (non-technical!) people became
even more important
23
Interactive Constraint Propagation
When it comes to managing jobs and resources,
change is the name of the game.
Users want to update and fine-tune schedule in a
flash, allowing:
– a scheduling engine to react to the constant changes
– inform them about possible consequences of manual
overrides
– automatically adjust the schedule after manual changes
These problems are common whether you are trying
to assign people to jobs, connect plants to the supply
chain, or to minimize travel time for different field
service crews
Dynamic constraint propagation becomes a must
functionality of any practical constraint-based system.
It assumes the ability to add and/or remove (!)
constraints on the fly to redefine the problem and find
the appropriate solution
24
Between 0 to 100% Scheduling Automation
It is unreal to achieve 100% automation for
scheduling:
• Permanent changes in job priorities and resource
availability
• The efficiency and constraint satisfaction are crucial
• Compromise between time and quality
0% automation still should allow users to do
scheduling better what they did before:
• Warn a user about problems without being too “talkative”
• Allow a user to violate constraints
A “Big” Scheduling Engine should be able to provide
100% automation, but with respect to manual
overrides. There are no pure “advisory” or “manual”
modes: always a combination!
25
Typical CP Engine
Scheduling
Engine uses a
specialized
search strategy
to solve this CSP.
It modifies the
state of the
constrained
environment
J1
R1
J2
R2
J3
R3
Scheduling Engine
26
Batch Scheduling Engines
J1
GUI
DB
R1
J2
R2
J3
R3
Scheduling Engine
27
Initial Step to Constrained Graphical Interface
J1
GUI
Java and
Constrainer
DB
R1
J2
R2
J3
R3
Scheduling Engine
C++ and ILOG
28
Common Core for both GUI and Scheduling
Engine
J1
GUI
R1
J2
R2
J3
R3
DB
Scheduling Engine
29
Interactive
Consistent Constrained Core - CCC
Manual and
automatic Actions
modify the state of
the constrained
environment under
control of the same
constraints
User Actions: ”Small” Engines
Action
Action
J1
R1
Action
J2
R2
Action
J3
R3
Action “Big Scheduling Engine”
30
CCC: Business & Constrained Objects
Business Objects
• reflect the current state of the “visual” objects
• allow non-monotonic changes
Constrained Object
• only monotonic changes
• when not in action, they are in the initial state with static
constraints propagated
• after actions executed, save their state in the business object
and restore
31
Consistent Constrainer Core:
Business & Constrained Cores
•Request
Web
Browser
Windows
Scheduling
Clients
•Response
•Question
•Event
•Business
Action
• Constrained
Action
Business
Core:
Constrained
Core:
•Job(s)
•Resource(s)
•Skill(s)
•Assignment(s)
• Constrained
Job(s)
• Constrained
Resource(s)
Live Scheduling Server
32
Constrained Graphical Interface vs
Interactive Constraint Engine
Constrained Graphical Interface:
• Constraint Engine “always” runs (demons are
active)
• Constraint Engine could handle GUI events
• Immediate business actions can add/remove
constraints
Interactive Constraint Engine:
•
•
•
•
Engine can run for a long time
Engine provides a GUI update every X sec
A user can pause/resume the Engine’s run
While the Engine is paused, a user can
add/remove constraints, and “resume” engine
execution or start it over
34
How to deactivate constraints?
Different approaches
 Attempt to restore the state of constrained variables after a
constraint removal
 Restore everything
 Differentiate between removable (soft) and frozen (hard)
constraints defined by business users
 Activation of a removable constraint creates a choice point
Recent new findings
 Use of filtering algorithms for soft constraints (J-C Regin, J-F
Puget, T. Petit) can dramatically improve efficiency
 Latest ILOG Solver’ infeasible constraints can call a userdefined demon instead of causing a global failure. This allows
an application to determine how to react to constraint failures.
Can be used for constraint removal?
Looking for more discussions and further research
35
Interactive Constraint Engine
Implementation ideas:
• Engine’s run is a special CCC goal “activate”
• Check GUI events:
 in a choice point
 every 10 sec, after 200 failures, etc.
• Pause:
 saves the state of all decision variables in the
business objects
• Allow a user to modify the saved values
• Resume:
 Add saved values to the list of activated constraints
 Activate the same goal
36
A User At a Choice Point
Choice
Point
Choice
Point
Choice
Point
Batch Search
Choice
Point
Interactive Search
37
Chess as a model for the Interactive CSP (1)
Man vs Man
38
Chess as a model for the Interactive CSP (2)
Man vs Computer
Kasparov
Deep Blue
39
Chess as a model for the Interactive CSP (3)
(Man+Computer) vs (Man+Computer)
Analogies:
– Racing (Formula-1)
– Player = Scheduling Analyst, Plant Manager
– Game = Process of Ongoing Improvements
40
Choice Point Visualization
Any chess position (choice point) has a “shape”
favorable or unfavorable at this particular moment to
this particular player
“I can hear the moves” (V. Nabokov. “The defense”)
Dynamically configurable strategies
– “They tuned it to play against me personally”
 Kasparov about the “Deep Blue”
41
Interaction in a Choice Point
A man with a computer in a choice point
What to present to a human about the current
search situation:
–
–
–
–
Search Size Estimate
Search Time Estimate
Search Complexity Estimate
Preferable resulting positions (no knights, “boring”
position, minimum inventory, minimized overtime, etc.)
42
Thank You.
Q&A