Bellman-F o r d s A lg o r i t h m The id ea: There is a shortest p ath f rom s to any other verte that d oes not contain a non-negative cy cle ( can

Similar documents
W Table of Contents h at is Joint Marketing Fund (JMF) Joint Marketing Fund (JMF) G uidel ines Usage of Joint Marketing Fund (JMF) N ot P erm itted JM

What are S M U s? SMU = Software Maintenance Upgrade Software patch del iv ery u nit wh ich once ins tal l ed and activ ated prov ides a point-fix for

M M 3. F orc e th e insid e netw ork or p rivate netw ork traffic th rough th e G RE tunnel using i p r ou t e c ommand, fol l ow ed b y th e internal

B ench mark Test 3. Special Segments in Triangles. Answers. Geometry B enchmark T ests. 1. What is AC if } DE is a midsegment of the triangle?

T h e C S E T I P r o j e c t

Table of C on t en t s Global Campus 21 in N umbe r s R e g ional Capac it y D e v e lopme nt in E-L e ar ning Structure a n d C o m p o n en ts R ea

A L A BA M A L A W R E V IE W

Agenda Rationale for ETG S eek ing I d eas ETG fram ew ork and res u lts 2

The Ind ian Mynah b ird is no t fro m Vanuat u. It w as b ro ug ht here fro m overseas and is now causing lo t s o f p ro b lem s.

Geometric Predicates P r og r a m s need t o t es t r ela t ive p os it ions of p oint s b a s ed on t heir coor d ina t es. S im p le exa m p les ( i

P a g e 5 1 of R e p o r t P B 4 / 0 9

OH BOY! Story. N a r r a t iv e a n d o bj e c t s th ea t e r Fo r a l l a g e s, fr o m th e a ge of 9

I zm ir I nstiute of Technology CS Lecture Notes are based on the CS 101 notes at the University of I llinois at Urbana-Cham paign

P a g e 3 6 of R e p o r t P B 4 / 0 9

THIS PAGE DECLASSIFIED IAW E

Grade 10 Arithmetic Progressions

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

Software Process Models there are many process model s in th e li t e ra t u re, s om e a r e prescriptions and some are descriptions you need to mode

Provider Satisfaction

FOR SALE T H S T E., P R I N C E AL BER T SK

Title: A LI GN M E N T / H A N DLI N G DI A GN O SI S: FRO N T WH E E L A LI GN M E N T : A DJU ST M E N T ( V enza)

CPU. 60%/yr. Moore s Law. Processor-Memory Performance Gap: (grows 50% / year) DRAM. 7%/yr. DRAM

On the M in imum Spann ing Tree Determ ined by n Poin ts in the Un it Square

The Ability C ongress held at the Shoreham Hotel Decem ber 29 to 31, was a reco rd breaker for winter C ongresses.

TG-0 Mira Act ivities: Using the mira* S6 E F


Dangote Flour Mills Plc

Emerging Trend Mini-Me Pets

(2009) Journal of Rem ote Sensing (, 2006) 2. 1 (, 1999), : ( : 2007CB714402) ;

V o l. 21, N o. 2 M ar., 2002 PRO GR ESS IN GEO GRA PH Y ,, 2030, (KZ9522J 12220) E2m ail: w igsnrr1ac1cn

This Specification is subject to change without notice

Grade 10 Arithmetic Progressions

Certificate Sound reduction of building elements

DETAIL MEASURE EVALUATE

STANDARDIZATION OF BLENDED NECTAR USING BANANA PSEUDOSTEM SAP AND MANGO PULP SANTOSH VIJAYBHAI PATEL

Alles Taylor & Duke, LLC Bob Wright, PE RECORD DRAWINGS. CPOW Mini-Ed Conf er ence Mar ch 27, 2015

C o r p o r a t e l i f e i n A n c i e n t I n d i a e x p r e s s e d i t s e l f

I N A C O M P L E X W O R L D

H STO RY OF TH E SA NT

MATH 310 TEST Measure April Answers

Grade 8 Algebraic Identities

Class 4 Large Numbers

A Comparison of Two Methods of Teaching Computer Programming to Secondary Mathematics Students.

176 5 t h Fl oo r. 337 P o ly me r Ma te ri al s


U S H E R I N G I N T H E

M Line Card Redundancy with Y-Cab l es Seamless Line Card Failover Solu t ion f or Line Card H ardw or Sof t w are Failu res are Leverages hardware Y-

Rotary D ie-cut System RD series. RD series. Rotary D ie-cut System

THIS PAGE DECLASSIFIED IAW EO IRIS u blic Record. Key I fo mation. Ma n: AIR MATERIEL COMM ND. Adm ni trative Mar ings.

EKOLOGIE EN SYSTEMATIEK. T h is p a p e r n o t to be c i t e d w ith o u t p r i o r r e f e r e n c e to th e a u th o r. PRIMARY PRODUCTIVITY.

e-hm REPAIR PARTS REPAIR PARTS ReHM R3

VERIZON Specific Published Vacancy

Spontaneous reactions occur only between the reactants shown in red.

Form and content. Iowa Research Online. University of Iowa. Ann A Rahim Khan University of Iowa. Theses and Dissertations

A Generalization of a result of Catlin: 2-factors in line graphs

/ T he F r oniu s S e r v i c e Partn e r P r o g r a mme.

Th e E u r o p e a n M ig r a t io n N e t w o r k ( E M N )

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

o Alphabet Recitation

Inst it ut e fo r Humane Educat io n Grades: 9, 10, 11, 12 St at es: Common Core State Standards Subje ct s: Mathematics

Grade 6 Integers. Answer t he quest ions. Fill in the blanks. For more such worksheets visit

Ch. 2 Math Preliminaries for Lossless Compression. Section 2.4 Coding

S ca le M o d e l o f th e S o la r Sy ste m

A Ge ne ric B la ckboa rd2b a se d D a ta Fus ion S ys tem

Shortest Path Algorithms

COMPILATION OF AUTOMATA FROM MORPHOLOGICAL TWO-LEVEL RULES

Executive Committee and Officers ( )

Class 4 Decimals. Answer t he quest ions. Choose correct answer(s) f rom given choice. For more such worksheets visit

K owi g yourself is the begi i g of all wisdo.

(IGBP) km 2,? PRO GR ESS IN GEO GRA PH Y. V o l. 20, N o. 4 D ec., 2001 : (2001) m m 3,

Science: Biology. Paper igher ier [G0903] hour minutes

Chapter 5 Solutions. Problem 5.1

CHAPTER 1: TOOLS FOR ALGEBRA AND GEOMETRY

Class 4 Fractions. Answer t he quest ions. For more such worksheets visit

J A D A V PUR U N IV ERS IT Y K O LK AT A Fa cu lty of En gi n eer in g & T e ch no lo gy N O T I C E

We Live at Nature s Wh im

3. 1% 1. 7% 0. 8% 0. 5% 0. 1% ;

HONDA 4 cylinder Goldwing. Instruction manual with visual guide for the Gen 5 Goldwing GL1000 & GL1100


FDY300NZ Single N-Channel 2.5V Specified PowerTrench MOSFET

Benchm ar k One St ud y Guid e: Science Benchm ar k Wed. Oct. 2nd

Carrier Ethernet P ro d u c ts U p d ate Josef Ungerman C S E, C C I E #

T H E Y T R O N - Y P R I N C I P L E

Building Harmony and Success

A study of intra-urban mobility in Omaha

Gen ova/ Pavi a/ Ro ma Ti m i ng Count er st at Sep t. 2004

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes

Robbery > J. œ œ. œ b œ. œ œ œ œ. œ œ œ œ œ œ œ. œ J. œ œ œ. b œ œ œ # œ ? 4. œ J. b œ œ œ # œ Ó. # b œœ. œ œ. œ J. œ Œ Ó & œ - œ - œ - œ - Kbds, Str

MLSE in a single path channel. MLSE in a multipath channel. State model for a multipath channel. State model for a multipath channel

Neptunian Night for three retuned, computer-driven pianos

F l a s h-b a s e d S S D s i n E n t e r p r i s e F l a s h-b a s e d S S D s ( S o-s ltiad t e D r i v e s ) a r e b e c o m i n g a n a t t r a c

Chapter 5 Workshop on Fitting of Linear Data

ID: V i e w A l l F i r s t 1 of 1 L a s t

S O M A M O H A M M A D I 13 MARCH 2014

A Study of Drink Driving and Recidivism in the State of Victoria Australia, during the Fiscal Years 1992/ /96 (Inclusive)

Class 8 Introduction to Graphs

Beechwood Music Department Staff

June 1, Dear Parents of Sixth Graders,

Fragment Processor. Textures

RASPBERRY ISLAND DREAMING I. THE RIVER IS LIBBY LARSEN

Transcription:

W Bellman Ford Algorithm This is an algorithm that solves the single source shortest p ath p rob lem ( sssp ( f ind s the d istances and shortest p aths f rom a source to all other nod es f or the case w here the w eights can b e negative. I f there is a negative cy cle, the shortest p ath and the d istance are not w ell d ef ined. The algorithm returns a negative cy cle e ists. e w ill see an ap p lication f or S olving a System of D i ffer en c e C on str a i n ts

Bellman-F o r d s A lg o r i t h m The id ea: There is a shortest p ath f rom s to any other verte that d oes not contain a non-negative cy cle ( can b e eliminated to p rod uce a lighter p ath. The ma imal numb er of ed ges in such a p ath w ith no cy cles is V -, b ecause it can have at most V nod es on the p ath if there is no cy cle. it is enough to chec p aths of up to V - ed ges

for Bellman-F o r d s A lg o r i t h m Initialize( G, s for i to V for each edge if each edge ( v, w E[ G] do if dist(w > dist(v + c ( v, w dist( w = dist( v + c( v, w Parent( w = v dist ( v, w E[ G] [ w] > d[ v] + c( v, w return "negative cycle"

Bellman-F o r d s A lg o r i t h m The first pass over the edges on l y n eighb ors of s are affec ted ( edge paths. A l l shortest paths w ith on e edge are fou n d. The sec on d pass shortest paths of 2 edges are fou n d A fter V - passes, al l possib l e paths are c hec ed. W e c l aim : w e n eed to u pdate an y verte in the l ast pass if an d on l y if there is a n egative c y c l e reac hab l e from s in G.

$ % ( & & # Bellman Ford Algorithm # "! #,... v v v, v = * % dist(w dist(v c ( v, w '

W e c an w rite for al l edges in the c y c l e dist(v dist(v... dist(v 3 2 dist(v dist(v dist(v 2 - + c + c + ( v, v ( v, v c 3 2 2 ( v, v i 2 dist( v i dist( v A fter su m m in g u p over al l edges in the c y c l e, w e disc over that the term on the l eft is eq u al to the first term on the right( j u st a differen t order of su m m ation. W e c an su b tru c t them, an d w e get that the c y c l e is ac tu al l y positive, w hic h is a c on tradic tion. i + c( v, v

Bellman-F o r d R u n T i me The algorithm run time is: G oes ov er v - v erte es, O ( V F or eac h v erte rela ation ov er E, O ( E A ltogether O ( V E

A p p li c at i o n o f Bellman-F o r d The B ellman-f ord algorithm c an b e used to solv e a set of d if f erenc e c onstraints f or n v ariab les, li e the f ollow ing set of linear ineq ualities : 3 3 4 5 4 5 3 5 3 4 4 3 5 2 5 2

A p p li c at i o n o f Bellman-F o r d There are many uses f or a set of d if f erenc e c onstraints, f or instanc e: The v ariab les c an rep resent the times of d if f erent ev ents The ineq ualities are the c onstraints ov er there sy nc hroniz ation.

W A p p li c at i o n o f Bellman-F o r d hat is the c onnec tion b etw een the B ellman-f ord algorithm and a set of linear ineq ualities? W e c an interp ret the p rob lem as a d irec ted grap h. The grap h is c alled the constraint graph of the p rob lem A f ter c onstruc ting the grap h, w e c ould use the B ellman- F ord algorithm. The result of the B ellman-f ord algorithm is the v ec tor that solv es the set of ineq ualities.

Application of Bellman-F or d Building the constraint graph: E a c h v a r ia b le c o r r es p o nds to a no de i E a c h c o ns tr a int j i ij c o r r es p o nds to a n edge f r o m v to v w ith w eight b i j ij b v i W e a dd a s p ec ia l no de v a nd w e a dd edges f r o m o this s p ec ia l no de to a ll o ther no des. T he w eights o f thes e edges a r e.

Application of Bellman-F or d T he c o ns tr a int gr a p h: v - v 2 v v 5 4 5-3 v 4-3 - v 3

W Note the similarity between the constraints on the v ariables, and the cond itions f or the p ath to be shortest in the B ellman F ord alg orithm. e now ap p ly the B ellman F ord alg orithm on the g rap h, with the sou rce being the e tra nod e v o

Application of Bellman-F or d T he s o lutio n: v -5 - -3 v 2 v v 5-4 -3 v 4 4-5 -3 - v 3

! #! " Application of Bellman-F or d ( i i v = dist "

Suppose Bellman Ford did not find a cycle, and output a solution dist( v,dist( v 2. So at th e final iteration of th e alg orith m, all edg es satisfied dist(w dist(v + ( v w c, So our ch oice = dist( v means th at all constraints are satisfied. i i N ow if Bellman-Ford did find a cycle, th en w e claim th ere can not b e a solution. Because if th ere is a solution, w h ich satisfies th e set of constraints, w e h av e,... n b for all th e constraints. A mong all th ese ineq ualities, let us j ust pic th ose w h ich correspond to th e edg es in th e neg ativ e cycle in th e g raph. Summing all th ese constraints w e find j ust li e b efore th at th e cycle is non neg ativ e, so w e g et a contradiction as b efore. j i ij

Application of B e llm an F or d This shows that the Bellman Ford algorithm f inds a solu tion f or the set of dif f erenc e c onstraints, and if there is no solu tion, it tells u s ab ou t it. N ote that if we f ou nd a solu tion, adding to all v ariab les a c onstant c still giv es a solu tion. This is an ap p lic ation of the adv antage of the grap h data stru c tu re in a slightly less e p ec ted p lac e than we saw b ef ore.