Topics for this week Backtracking: - a brute-force technique that - - PowerPoint PPT Presentation

topics for this week
SMART_READER_LITE
LIVE PREVIEW

Topics for this week Backtracking: - a brute-force technique that - - PowerPoint PPT Presentation

[Week 3] Topics for this week Backtracking: - a brute-force technique that finds a solution by trying all possibilities - related data structures - pruning to eliminate certain possibilities from the search - time complexity: usually really


slide-1
SLIDE 1

Topics for this week

Backtracking:

  • a brute-force technique that finds a solution by trying all

possibilities

  • related data structures
  • pruning to eliminate certain possibilities from the search
  • time complexity: usually really bad (exponential)

[Week 3]

slide-2
SLIDE 2

Problem: Map Coloring

How to color a map so that no two neighboring states have the same color ? Want: the smallest number of colors (to minimize costs)

slide-3
SLIDE 3

Problem: Map Coloring

Idea (brute-force):

slide-4
SLIDE 4

Backtracking

Brute-force via backtracking:

slide-5
SLIDE 5

Backtracking

Brute-force via backtracking with pruning:

slide-6
SLIDE 6

Backtracking

Testing: Time complexity: