1 / 28

DM OR

DM OR. Networks. Graphs : Koenigsberg bridges. Leonard Euler problem (1736). Nodes. Edges. Is there a walk which uses each edge exactly once ?. Build two more bridges . Each such walk has to enter and leave any given node . The degree of any node has to be even .

ayoka
Download Presentation

DM OR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DMOR Networks

  2. Graphs: Koenigsberg bridges Leonard Euler problem (1736)

  3. Nodes

  4. Edges

  5. Isthere a walk whichuseseachedgeexactlyonce?

  6. Buildtwomorebridges.

  7. Eachsuch walk has to enter and leaveanygivennode. Thedegree of anynodehas to be even.

  8. Euleriancycle Hamiltonian cycle Travelling salesman problem

  9. TSP - cycle Duration: 2 d 7 h 2 m Length: 3615 km

  10. TSP - trail Duration: 2 d 4 h 37 m Length: 3436 km

  11. TSP – a real walk Duration: 29 d 11 h 21 m Length: 3485 km

  12. Travelling salesman problem TSP • Mathematically • Variablexij= 1, ifthesalesmanpassesfromitoj, 0 otherwise • Goingfrom one city to the same city isforbidden • Isthisall ???

  13. TSP • Isthisall? • Let’ssayoursolutionwith 5 citiesisx12=x23=x31=x45=x54=1 • Itsatisfiesalltheconstraints. But itinvolvessubtours (cyclesinvolvingfewerthanallcities) • We need to introduceadditionalconstraints

  14. Subtourelimination • For twocities • For threecities • For fourcities • Etc. • In practicalimplementationtoo many constraints: with30 citiestherewould be 870 constraintseliminatingonlysubtours of length 2

  15. Subtoureleimination– secondapproach • Introducenonnegativevariablesui: • Subtoursareeliminated • How many suchconstraints? • (N-1)2-N, i.e. with30 citiestherewould be 812constraints.

  16. Game • http://www.tsp.gatech.edu/games/index.html

  17. Introduction to networks • Twomainelements: • arcs/edges • nodes • A graphis a structureconsisting of nodes and arcsbewteennodes • A directedgraph(a digraph)is a graphinwhicharcshave a givendirection • A networkis a graph(ordigraph), inwhicharcshave a flowassigned to it • Simple examples:

  18. Introduction to networks • Chainis a sequence of arcsconnectingtwonodesiandj, e.g.figure on theright: ABCE, ADCE • Pathis a sequence of directedarcsconnectingtwonodes , e.g. figure on therightABDE, but not ABCE • Cycle is a chain, whichconnects a nodewiththe same nodewithoutanyrepetition (retracing) e.g. figure on therightABCEDA, but not ABCDECBA • Connectedgraph/network hasonly one part Graph Directedgraph

  19. Introduction to networks • Tree – a connectedgraphwhichdoes not havecycles. • Spanningtreeis a treechosenamongarcsinthegraph so thatallnodesinthetreewereconnected Twospanningtrees Twotrees • Flowcapacity – upper (sometimesalsolower) limit for theflowat a givenarcinthenetwork, e.g. maximalnumber of cars thatcan pass per minuteat a givenroad • Sourceis a nodewhichintroduces a flowintothenetwork • Sinkis a nodewhichtakestheflow out of thenetwork

  20. The shortest route problem • Formulation:For a givengraphinwhicheveryarcisassignedwith a distancebewteenthetwonodesitconnects, whatistheshortestpathbetweennode i and j. • Example: Whatistheshortestroutebewteen A and H? Enumeration – impractical Dijkstraalgorithm

  21. Dijkstraalgorithm http://optlab-server.sce.carleton.ca/POAnimations2007/DijkstrasAlgo.html

  22. Minimum spanning tree • Formulation:For a givengraph, inwhicheveryarcisassignedwith a distancebetweenthetwonodesitconnects, find a spanningtreethathasminimaltotallength. • Example: Findminimallength for a wirethatconnectsalltheofficesinthebuildingwhenalltheavailablewirepathsaregiven. • Algorithm: http://optlab-server.sce.carleton.ca/POAnimations2007/MinSpanTree.html An example of the so calledgreedy algorithm –itdoeswhat’sbestin a given step not lookingattheotherstages of the problem (usuallyineffective – hereitiseffective!) One can do a maximalspanningtreethe same way

  23. Maximum flow and the minimum cut • Formulation:Whatisthemaximalflowbetweentwogivennodesin a graph? Eachnodeisassignedwith a maximalflow. • Example: Find a maximalflow of cars from an underground parking lot downtown to themotorwayentrance. • Eacharcisassignedwith a maximalsimultaneousflowbetweenthetwonodesitconnects • Maximalflowmaydifferdepending on theflowdirection (e.g. one-waystreets) Examplesolution: 4 cars/m on route A-D-E-G 3 cars/m ojnroute A-B-E-G 4 cars/m on route A-C-F-G Total flowbetween A and G is11 cars/m Isthisoptimal???

  24. Maximum flow and the minimum cut • Algorithm: Ford and Fulkerson (Canadian Journal of Mathematics 1956) http://optlab-server.sce.carleton.ca/POAnimations2007/MaxFlow.html

  25. Maximumflow/minimum cut • In Ford Fulkersonalgorithm, why do we need to addflowintheoppositedirection? • Accountingconventionthatkeepstrack of theflowthat, ifnecessary, can be reversed.

  26. Maximumflow/minimum cut • Maximumflowiscloselyrelated to minimum cut: • A cutin a graphis a set of directedarcswhichcontainsatleast one arcineverypossiblepathfromthesource to thesink. If we removearcsfrom a givencut, theflowfromthesource to thesink will no longer be possible. • Cutvalueisthe sum of allflowcapacities (directionfromthesource to thesink) for eacharcin a cut. • Possiblecutswithcutvaluesindicated on them

More Related