Chapter 1' Problems and Algorithms - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Chapter 1' Problems and Algorithms

Description:

Starting from the onshore base, what is the cheapest (shortest) route to visit ... Hamilton (1859): regular dodecahedron ( 12 pentagonal faces and 20 nodes, ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 16
Provided by: solabK
Category:

less

Transcript and Presenter's Notes

Title: Chapter 1' Problems and Algorithms


1
Chapter 1. Problems and Algorithms
  • 1.1 Two Problems
  • The Traveling Salesman Problem
  • 47 drilling platforms off the coast of Nigeria.
  • Need to visit platforms by a helicopter to
    regulate the rates of flows.
  • Starting from the onshore base, what is the
    cheapest (shortest) route to visit each platform
    once and return to the base?
  • Euclidean traveling salesman problem.
  • Input a set V of points in the Euclidean plane.
  • Objective Find a simple circuit passing through
    the points for which the sum of the lengths of
    the edges is minimized.
  • Enumeration (n-1)!/2 ways
  • No efficient algorithm is known. (NP-hard)

2
  • Related problem Hamiltonian cycle (circuit) (a
    closed simple path that visits each node of a
    graph G (V, E) exactly once)
  • Hamilton (1859) regular dodecahedron ( 12
    pentagonal faces and 20 nodes, visiting cities in
    the globe)

3
  • There exist graphs for which Hamiltonian cycle
    doesnt exist.

Petersen graph
4
  • Q Does there exist easily identifiable necessary
    and sufficient conditions to determine whether an
    arbitrary graph G is Hamiltonian?
  • Unlikely, the problem is NP-complete.
  • Three types of problems in combinatorics
  • Existence problems
  • Enumeration problems
  • Optimization, construction problems

5
  • The Matching Problem
  • Drawing a logic circuit using a plotter, assume
    graph is connected.
  • Total drawing time pen-down pen-up
  • minimize pen-up time

odd nodes
even nodes
6
  • Seven bridges in Königsberg Eulers problem

7
  • Def Euler trail of a connected graph G A trail
    (edge-simple path) that traverses every edge of
    G.
  • Def Tour of G closed walk(path in the text)
    that traverses each edge of G at least once.
  • Euler tour tour that traverses each edge
    exactly once (a closed Euler trail)
  • A graph is called eulerian if it contains an
    Euler tour.

8
  • Thm A nonempty and connected graph is eulerian
    if and only if it has no nodes of odd degree.
  • Pf) ?) clear
  • ? ) Induction on E.
  • True for E 0. Assume true for m-1 edges.
  • A connected graph with m ? 1 edges and each node
    has even degree ? ? edge-simple closed path P.
  • G\P gives a graph with one or more components
    and each component is eulerian by induction
    hypothesis. Each component has a node in common
    with P.
  • Now splice P and the Euler tours of the
    components. ?
  • Note that an algorithm to find an Euler tour can
    be designed using the idea of the proof.

9
  • Cor A connected graph has an Euler trail if and
    only if it has at most two nodes of odd degree.
  • Pf) the number of nodes of odd degree is even
    ( ? v ? V d(v) 2E )
  • ?) clear
  • ?) If all nodes even degree, true from the
    theorem.
  • If two nodes of odd degree ( say u, v ), add
    edge (u, v) to G, get an eulerian graph. Now
    delete (u, v) in a Euler tour starting from u. ?

10
  • Back to circuit drawing
  • If the circuit diagram is eulerian, we can draw
    the diagram without lifting the pen.
  • If the diagram is not eulerian, add some edges
    (pen-up movement) to make the diagram eulerian.
    Which edges to add to minimize the pen-up
    movement?
  • t(p, q) time to move (up or down) from point p
    to q.
  • Assume t satisfies triangle inequality for any
    points p, q, r, we have t(p, r) ? t(p, q)
    t(q,r).
  • Then extra edges added only pair up the odd nodes

11
  • Euclidean Matching Problem
  • Input A set V of points in the Euclidean plane.
  • Objective Find a set of lines, such that each
    point is an end of exactly one line (perfect
    matching), and such that the sum of the lengths
    of the lines is minimized.
  • Efficient algorithm exists. (Edmond, 1965)

12
  • A problem similar to the circuit drawing problem
  • Chinese Postman Problem
  • Given a connected graph G (V, E), edge cost ce
    ? 0, e ? E.
  • Find a minimum cost closed path (walk)
    traversing every edge at least once.
  • approach) Duplicate an edge with the same cost
    if postman needs to traverse the edge again
  • ? make the graph eulerian by duplicating edges
    while the sum of costs of additional edges is
    minimized.
  • Note that we do not need to duplicate an edge
    more than once.

13
  • Example
  • Note the difference between the circuit drawing
    and the chinese postman problem.
  • Other variations directed graph, mixed graph
  • More on this problem later when we study T-join.

14
  • 1.2 Measuring Running Times
  • Efficiency of an algorithm measured by giving
    upper bounds on the number of steps required to
    solve a problem of a given size.
  • Arithmetic model each elementary operation has
    unit cost, regardless of the length of the
    numbers
  • Bit model numbers represented in binary
    notation and arithmetic operation is carried out
    bit by bit.
  • Def f, g Z ? R
  • We say f(n) O(g(n)) if ? c gt 0 and n0 such
    that f(n) ? c?g(n) ? n ? n0.
  • e.g.) 5n2 3n is O(n2), 35 ?2n n3 is O(2n).
  • Def We say that an algorithm is a polynomial
    time algorithm if the running time bound is O(nk)
    for some fixed k, where n is the problem size (
    in arithmetic or bit model )

15
  • If an algorithm is polynomial time in arithmetic
    model and the size of the numbers appearing in
    the algorithm do not grow too fast ( i.e., if t
    is the number of bits to represent problem data,
    the length of encoding of numbers occurring in
    the algorithm is O(tk) for some fixed k), it is
    polynomial time algorithm in bit model too. (
    most cases)
Write a Comment
User Comments (0)
About PowerShow.com