maximizing profit, minimizing time, optimizing working conditions: modeling your business to have it...
TRANSCRIPT
![Page 1: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/1.jpg)
Maximizing Profit, Minimizing Time, Optimizing Working Conditions:
Modeling your Business to have it all!
Yves Lucet
Professor Computer Science
UBC Okanagan
![Page 2: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/2.jpg)
Software Developmentvs.
Optimization• Discuss feature/pb with client, obtain input data for
acceptance tests• Implement prototype feature/model using off-the-
shelf components/solvers• Pass unit tests• Pass given acceptance tests• Could you add that? / Your solution is good… but• get better understanding of feature/pb. • iterate till client is happy or budget is depleted
![Page 3: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/3.jpg)
What is the most critical in software development?
A. Understanding the requirements
B. Efficiency of the software: fastest using least resources
C. Fastest development
D. Cheapest software
E. None of the above
![Page 4: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/4.jpg)
Overview
1. Simple modeling
2. Recognizing easy vs. hard problems
3. Opportunities
All images are copyright of their respective owners and used under the fair use clause.
![Page 5: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/5.jpg)
When to optimize
• Problem is too complex: modeling it helps understanding it like writing requirements help communicating with the client.
• Problem is too large to solve on paper.
• Problem is naturally an optimization pb.
• A small improvement toward a solution gives huge savings e.g. 1% improvement gives millions of dollar in savings.
![Page 6: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/6.jpg)
When NOT to optimize
• Problem is small: manual solution works fine
• Greedy algorithm gives the best solution already
• Problem would require unreasonable effort to make a significant difference with the current approach
• Problem is too hard to be solved other than by heuristic
![Page 7: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/7.jpg)
Operations Research
Operations research (OR) is an interdisciplinary branch of applied mathematics and formal science that uses methods such as mathematical modeling, statistics, and algorithms to arrive at optimal or near optimal solutions to complex problems.
![Page 8: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/8.jpg)
Faster than sampling
![Page 9: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/9.jpg)
Evolution of an optimization problem
1. Manual approach or semi-automated: • draw graphs, • use experience
2. Standard optimization: black box function with off the shelves solver
3. Customized solver
![Page 10: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/10.jpg)
Example: Team selection
• Objective: create the “best” teams• Solution/Variables: assignments of people
into teams• Constraints:
– black list, – spread skills among teams, – team size,– compatible schedule, people wish to tackle
specific projects, etc.
![Page 11: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/11.jpg)
Example: Team selection
Variables: T: t x s boolean matrixTi,j = 1 if programmer j belongs to team i
1 0 0 0 1 1 0
0 0 0 1 0 0 1
0 1 1 0 0 0 0
T =
A programmer can only be assigned to one team: 1, i
jiT
![Page 12: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/12.jpg)
Example: Team selection
Black list: B: s x s boolean matrixBi,j = 1 if programmers i doesn’t want to work with programmer j
0 1 0 0
0 0 1 1
1 0 0 0
0 1 1 0
B =
Many 1 in column j: nobody wants to work with jMany 1 in row i: i does not want to work with anybody
![Page 13: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/13.jpg)
Example: Team selection
Skill: C: n x s matrixCi,j = rating of programmer j in skill i: 0 none, 3 average, 5 expert
0 3 0 0
0 2 4 1
0 4 0 0
5 1 1 0
C =
Project k requires at least 3 in skill i: add or max on peopleassigned to project k
![Page 14: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/14.jpg)
Example: Team selection
Objective:
• Soft constraints: penalize
• Hard constraints: reject
...min,
,,,,
ikijji
jjkik BBTT
0,
,,,,
ikijji
jjkik BBTT
![Page 15: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/15.jpg)
What is the key idea illustrated in the team building model?
A. Using matrices is more efficient than using lists
B. Penalizing unwanted choices by moving it from constraints to objective
C. Any constraint can be modeled using matrices and equalities/inequalities
D. All of the above
E. None of the above
![Page 16: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/16.jpg)
Modeling: Understanding your business
• Simulators
![Page 17: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/17.jpg)
Objective
• Maximize profit
• Minimize cost
• Maximize use of resources: – space, – material, – time: schedule
• working conditions: create the most efficient teams
![Page 18: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/18.jpg)
(Decision) Variables
• What is a solution?– schedule– resource allocation– amount to be shipped– amount to buy/sell
![Page 19: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/19.jpg)
Constraints
• Relations between the variables
• Filter unwanted possibilities
![Page 20: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/20.jpg)
Optimization
min f(x) subject to g(x) <= 0 and
h(x) = 0
Variable: x
Objective: f
Constraints: inequality: g
equality: h
![Page 21: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/21.jpg)
Are you familiar with…
A. programming
B. Some modeling (PERT charts, graphs…)
C. linear programming
D. using optimization solvers (Excel, CPLEX, Matlab, Scilab…)
E. All of the above
![Page 22: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/22.jpg)
Modeling in Excel
• Solver add-in
• Demo: toy problem:min x-y subject to x >=0, y>=0, x+y<=1
![Page 23: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/23.jpg)
Trip planning
Trip Planning
![Page 24: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/24.jpg)
Scheduling
• xi: start time of task i• end time: xi + duration of task i• constraints:
– task 1 must be finished before task 2 begins– start time of 2 is after start time of 1– x2 >= x1 + 4
• x20: artificial task of duration 0: end of project; requires all previous tasks to be finished. Scheduling
![Page 25: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/25.jpg)
Blending: What is the best mix?Ferdinand Feed Company receives four raw grains from which it blends its dry pet food the 8-ounce=0.5 lb mixture at minimum cost to meet the minimum daily requirements of 6 units of vitamin C, 5 units of protein, and 5 units of iron.
Cost and grain properties
Vitamin C Protein Iron
Grain Units/lb Units/lb Units/lb Cost/lb
1 9 12 0 $.75
2 16 10 14 $.90
3 8 10 15 $.80
4 10 8 7 $.70
Blending
![Page 26: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/26.jpg)
n-Queen
n-Queen Excel
n-Queen Scilab
![Page 27: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/27.jpg)
Earth moving problem• Given a road design (vertical & horizontal),
move the earth to cut hills, fill holes while minimizing moving costs
• Linear Programming pb: EASY!
![Page 28: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/28.jpg)
Earth moving problem (cont): Blocking sections
• We forgot to tell you… Some moves cannot happen till a hill is cut or hole filled since the grade is too steep
• Some moves require a bridge before they can be made
• Mixed Integer Programming pb: HARD
![Page 29: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/29.jpg)
Classifying problems
1. real/continuous vs. integer/discrete (MIP/MINLP)
2. convex vs. nonconvex
3. linear (LP) vs. nonlinear (NLP)
4. smooth vs. nonsmooth
• Others: quadratic, network flow, etc.
![Page 30: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/30.jpg)
![Page 31: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/31.jpg)
What makes a problem hard to solve
• The mathematical relationships between the objective and constraints, and the decision variables
• The size of the model (number of variables and constraints) and its sparsity
• The use of integer variables - memory and solution time may rise exponentially as you add more integer variables
![Page 32: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/32.jpg)
Easy vs. Hard
Hard = NP hard. Easy = Polynomial• Easy: Linear Programming, Convex• Hard: Discrete, nonconvex global optimization,
nonconvex quadratic programming
How about smooth?• Smooth: fast converging algorithm• Nonsmooth: slower convergence… sometimes
![Page 33: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/33.jpg)
What makes a problem hard to solve?
A. Mathematical relation between variables and constraints
B. Size
C. Presence of integer variables
D. B and C but not A
E. A, B and C
![Page 34: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/34.jpg)
How do they solve it?
• real value: – Linear: Simplex (Active Set), Interior Point (Newton)– Nonlinear: Newton (and variants)– Direct Search methods: Nelder-Mead…– Heuristics: Simulated Annealing, genetic algs…
• integer value: – Relax to get a bound– Build associated problem (dual)– Branch and Bound
![Page 35: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/35.jpg)
Relaxing: to make less severe or stringent
http://www.danaquillman.com/
![Page 36: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/36.jpg)
Smooth Problems: Amazing!
![Page 37: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/37.jpg)
Large Scale: Radiotherapy
![Page 38: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/38.jpg)
Existing Software
“Free”– lp_solve– SCIP (research only)– Scilab– Galahad (Lancelot…)
Commercial– Excel– CPLEX, ILOG (IBM)– GAMS– Matlab– LINGO– BARON– AIMMS– XPRESS-MP
http://wiki.mcs.anl.gov/NEOS/index.php/Optimization_Software_Guide
![Page 39: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/39.jpg)
http://scip.zib.de/
Performance
![Page 40: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/40.jpg)
![Page 41: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/41.jpg)
Most used algorithms
The most used algorithms are:
A. Simplex for linear programming
B. Nelder-Mead (sampling method)
C. Newton and variant
D. Simulated Annealing
E. Don’t know any of these algorithms so can’t answer
![Page 42: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/42.jpg)
1. Model small/easy problem in Excel
2. Ask experienced people for tips i.e. understand your solution: global, local, sensitivity, etc.
3. Contact researchers: They are always looking for problems to solve!
Keep in Mind: the best solution is the one that works for you!
![Page 43: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/43.jpg)
Opportunities & Funding
• Graduate students support: MITACS Accelerate program
• NSERC Student support: – Industrial Undergraduate Student Research Awards
(USRA)– Industrial Postgraduate Scholarships (IPS)– Industrial R&D Fellowships (IRDF)– Collaborative Research and Development (CRD)
Grants
• Industry/University contracts
http://www.nserc-crsng.gc.ca/Partners-Partenaires/IndPrograms-IndProgrammes_eng.asp
http://www.acceleratecanada.ca/
http://www.mitacs.math.ca
![Page 44: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/44.jpg)
What would you do if you suspect your problem can be solved with
optimization tools?A. Hand it to someone else i.e. run awayB. Call me to discuss itC. Write an ad hoc algorithm that seems to workD. Write a short specification, attempt to create a
model and use a solver; ask for advice if stucks.
E. Create an optimization model, use an off-the-shelf solver, and argue vehemently whatever output it gives is the best solution
![Page 45: Maximizing Profit, Minimizing Time, Optimizing Working Conditions: Modeling your Business to have it all! Yves Lucet Professor Computer Science UBC Okanagan](https://reader035.vdocument.in/reader035/viewer/2022070400/56649eff5503460f94c13ec3/html5/thumbnails/45.jpg)
Contact Information
• Yves Lucet, Computer Science,OCANA (Optimization Convex Analysis and Nonsmooth Analysis) research group
• OCANA Research group: http://people.ok.ubc.ca/ylucet/
• Patricia Lasserre, • Yves Lucet,• Shawn Wang.
• Heinz Bauschke, • Yong Gao, • Donovan Hare, • Warren Hare,