cosc 4426 topics in computer science ii discrete optimization good results with problems that are...

19
COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely http://mathworld.wolfram.com/ TravelingSalesmanProblem.html

Upload: shawn-marsh

Post on 31-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

COSC 4426 Topics inComputer Science II

Discrete Optimization

Good results with problems that are too bigfor people or computers to solve completely

http://mathworld.wolfram.com/TravelingSalesmanProblem.html

Page 2: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Difficult problems

hard to represent(what information, what data structures)

no known algorithms no known efficient algorithms

this course: discreet variable problems

Page 3: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Examples practical examples

scheduling (transportation, timetables,…) puzzles

crosswords, Sudoku, n Queens classic examples

SAT: propositional satisfiability problem(independent parameters)

CSP: constraint satisfaction problem(dependent parameters)

TSP: travelling salesman problem(permutations)

Page 4: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

SAT: propositional satisfiability problem

P1 P2 P1^P2

F F F

F T T

T F F

T T T

n propositions, P1, P2, P3, …, Pn

What combination of truth values makes a sentence true?

Table has 2n rows.

n=50, 250 = 1,125,899,906,842,624

n=2; 22 = 4 rows

Page 5: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

CSP: constraint satisfaction problem

example – map colouringn countries – 4 possible colours- constraints: adjacent

countries different colours- 4n combinations

n=13; 413 = 67,108,864 combinations; 25 constraints

Page 6: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

TSP: traveling salesman(sic) problem n cities: what is shortest path visiting all

cities, C1, C2, C3, …, Cn once? (n-1)! routes

from home cityon complete graph

n = 16;(n-1)! = 1,307,674,368,000

C1

n = 5; (n-1)! = 24

Page 7: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Silly Example – one variable

mark in class based on hours attended

number of hours, h, is between 0 and 36 find optimal attendance (best h) if

1. mark m is m = 3h - 82. mark m is m = 20h - h2

3. mark m is m = (5h/9 – 10)2 4. mark m is m = h3 mod 1015. mark m is m = markarray[h]

Page 8: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

m = 3h - 8

Page 9: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

m = 3h – 8

m = 20h - h2

m = (5h/9 – 10)2 global optimum

Page 10: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

m = h3 mod 101 local optimum

Page 11: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

m = h3 mod 101m = markarray[h]

Page 12: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

Page 13: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Problem description1. fitness function (optimization function, evaluation) –

e.g., m = h3 mod 1012. constraints (conditions) – e.g., 0 ≤ h ≤ 36find global optimum of fitness function withoutviolating constraints ORgetting stuck at local optimum small space:

complete search1. large space: ?????

Marking schemes

-25

0

25

50

75

100

0 6 12 18 24 30 36

attendance

grade

Page 14: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Large problems

more possible values more parameters, n = {n1, n2, n3, …} more constraints more complex fitness functions

- takes significant time to calculate m = f(n)

too big for exhaustive search

Page 15: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Searchingwithout searching everywhere

How to search intelligently/efficiently using information in the problem:-hill climbing-simulated annealing-genetic algorithms-constraint satisfaction-A*- …

Page 16: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Focusing search

assumption – some pattern to the distribution of the fitness function

finding the height of land in a forest- can only see ‘local’ structure- easy to find a hilltop but are there other higher hills?

Page 17: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Fitness function distribution

convex – easy – start anywhere, make local decisions

Page 18: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Fitness function distribution many local maxima

make local decisions but don’t get trapped

Page 19: COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely

Course outline

textbook – Michalewicz and Fogel(reasonable price, valuable book)

lectures, notes and ppt presentations evaluation

assignments project tests final exam