B Flows to Paths Dr. Greg Bernstein Grotto Networking www.grotto-networking.com.

Slides:



Advertisements
Similar presentations
B Capacitated Design: Part II Dr. Greg Bernstein Grotto Networking
Advertisements

Linear Programming (LP) (Chap.29)
1 EP2210 Fairness Lecture material: –Bertsekas, Gallager, Data networks, 6.5 –L. Massoulie, J. Roberts, "Bandwidth sharing: objectives and algorithms,“
If (justMetYou) { crazy = true; cout
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Control Structures Any mechanism that departs from straight-line execution: –Selection: if-statements –Multiway-selection: case statements –Unbounded iteration:
Single Variable and a Lot of Variables The declaration int k; float f; reserve one single integer variable called k and one single floating point variable.
B Multi-Layer Network Design II Dr. Greg Bernstein Grotto Networking
Introduction to Graph “theory”
B Network Design Problems: An Overview Dr. Greg Bernstein Grotto Networking Based on Chapter 2 of Pioro and Medhi
Chapter 9: Advanced Array Manipulation
1 EL736 Communications Networks II: Design and Algorithms Class3: Network Design Modeling Yong Liu 09/19/2007.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
B Network Dimensioning Problems: Where to put the capacity and how much… Dr. Greg Bernstein Grotto Networking
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Network Optimization Models: Maximum Flow Problems
The Out of Kilter Algorithm in Introduction The out of kilter algorithm is an example of a primal-dual algorithm. It works on both the primal.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Lecture 3. Notations and examples D. Moltchanov, TUT, Spring 2008 D. Moltchanov, TUT, Spring 2015.
The Program Design Phases
Investigate the degree to which programming concepts are interrelated Reshmi Ravi.
B Multi-Layer Network Design Dr. Greg Bernstein Grotto Networking
1 Spidering the Web in Python CSC 161: The Art of Programming Prof. Henry Kautz 11/23/2009.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 8 Linear Algebraic Equations PowerPoint to accompany Copyright © 2010.
ECE 643- Design and Analysis of Computer Networks K Shortest Paths Dept. of Electrical and Computer Eng. George Mason University Fairfax, VA ,
1 Chapter-4: Network Flow Modeling & Optimization Deep Medhi and Karthik Ramasamy August © D. Medhi & K. Ramasamy, 2007.
Computer Science 112 Fundamentals of Programming II Introduction to Graphs.
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
Representing and Using Graphs
1 Conditions Logical Expressions Selection Control Structures Chapter 5.
B Topological Network Design: Access Networks Dr. Greg Bernstein Grotto Networking
1 Debugging. 2 A Lot of Time is Spent Debugging Programs Debugging. Cyclic process of editing, compiling, and fixing errors. n Always a logical explanation.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Data Structures & Algorithms Recursion and Trees Richard Newman.
Linear Equations in Two Variables A Linear Equation in Two Variables is any equation that can be written in the form where A and B are not both zero.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
Project 2: Classification Using Genetic Programming Kim, MinHyeok Biointelligence laboratory Artificial.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
Network Information: Manipulation, Sharing, and Visualization Dr. Greg Bernstein Grotto Networking
1 Slides by Yong Liu 1, Deep Medhi 2, and Michał Pióro 3 1 Polytechnic University, New York, USA 2 University of Missouri-Kansas City, USA 3 Warsaw University.
1 EL736 Communications Networks II: Design and Algorithms Class7: Location and Topological Design Yong Liu 10/24/2007.
14. DICTIONARIES AND SETS Rocky K. C. Chang 17 November 2014 (Based on from Charles Dierbach, Introduction to Computer Science Using Python and Punch and.
CSC 445/545 is done at 4:30 so I did NOT fill in the box for 4:30 for our class. Please put your name here. Please put your as well. 1.
Guide to Programming with Python Chapter Five Lists and dictionaries (data structure); The Hangman Game.
September 7, 2004ICP: Chapter 3: Control Structures1 Introduction to Computer Programming Chapter 3: Control Structures Michael Scherger Department of.
Programming Languages Programming languages are a compromise between spoken language and formal math. They allow humans to communicate with computers at.
NETWORK FLOWS Shruti Aggrawal Preeti Palkar. Requirements 1.Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs. 2.For.
Project 1 : Phase 1 22C:021 CS II Data Structures.
1 EL736 Communications Networks II: Design and Algorithms Class4: Network Design Modeling (II) Yong Liu 10/03/2007.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Introduction to Programming G50PRO University of Nottingham Unit 6 : Control Flow Statements 2 Paul Tennent
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
Quiz 4 Topics Aid sheet is supplied with quiz. Functions, loops, conditionals, lists – STILL. New topics: –Default and Keyword Arguments. –Sets. –Strings.
L11. Link-path formulation
Types for Programs and Proofs
The minimum cost flow problem
Dictionaries, File operations
Structural testing, Path Testing
Uninformed Search Strategies
Learning to Program in Python
Coding Concepts (Basics)
Objective Graph and solve systems of linear inequalities in two variables.
TRLabs & University of Alberta © Wayne D. Grover 2002, 2003, 2004
Maximum Flow Neil Tang 4/8/2008
Vehicle routing in Python
A feasible solution for problem 2.
Presentation transcript:

B Flows to Paths Dr. Greg Bernstein Grotto Networking

Working with Numerical Results Fact – Link-Path and Node-Link formulations of network design problems produce a lot of variables whose values are “essentially” zero. Problem – How do we tell if a floating point number is “essentially” zero? – Never, ever, ever do this: If x == 0.0: # Bad, Bad, Bad, Terrible, Terrible!!! – Print “X is zero” # WRONG!!!!!!!!

Floating point computations Will the following loop ever exit? – It adds a smaller and smaller number to 1.0 and then checks if the result is equal to 1.0 – Try this in any language you like (this is not a Python specific result) – Theoretically what should the code do?

Floating Point Computations Loop terminates rather quickly Result – This is sometimes called the “machine epsilon” (or twice this value).

Floating Point in Python Python (like Java, C, C++) has information on numerical accuracy and limits See sys.float_info (need to import the sys module)

Quick Check Flow variable xflow = – Is this “essentially” zero? What if I told you the demand was 10Tbps? – xflow does seem “essentially” zero when compared to the demand.

Floating point comparisons Never check for equality between floating point numbers! Absolute error check: abs(x – y) <= small_number – Where small_number >> machine epsilon Relative error check: – abs(x-y) <= rel_err*RelatedNumber – abs(x-y) <= rel_err*[abs(x) + abs(y)] – Where rel_err >> machine epsilon

Example from Code Looking for links used to satisfy a demand – Compare the size of the link flow relative to the demand it should help satisfy (use machine epsilon)

Node-Link Formulation Issue Does a feasible solution always lead to realizable paths? – Comments in P&M page 111 & exercise 4.2 If so how can we get the paths from the flow variables? Reference: – D. P. Bertsekas and D. P. Bertsekas, Network Optimization: Continuous and Discrete Models. Athena Scientific, 1998.

Link Flows

Graph Flows I

Graph Flows II

Graph Flows III

Algorithm Implementation in Python Finds flows specific to a demand pair (not in general) – File: flow_paths.py – Function flowToPaths(demand, gflow) demand -- a pair of nodes identifiers indicating the source and sink of the flow. gflow -- a list of nested tuples (edge, flow value) where edge = (nodeA, nodeB) returns: a tuple of a list of the paths loads and a list of the corresponding paths

Helper function (Python) Search the solver solution values of the flow variables for "non-zero" link demand values. File: flow_paths.py – Function getDemandLinks(demands, link_list, flow_vars, no_splitting=False) demands -- a demand dictionary indexed by a demand pair and whose value is the volume link_list -- a list of links (edges) of the network as node tuples. flow_vars -- a dictionary of link, demand variables. In our case we are working with the solutions that have been returned from the solver. These are of type PuLP LpVariables. returns: a dictionary indexed by a demand pair whose value is a nested tuple of (link, load) where link is a node pair (tuple).