173 views

Uploaded by Shai Deshe

- 10.1.1.113.5469
- Sudoku.txt
- Edmond's Matching
- Scheduling
- Minimum Spanning Trees
- Graph Theory
- 10.1.1.50
- Pajek - Analysis & Visualization of Large Networks
- 2_-_Limits.docx
- Ada Lab Manual-rvce
- Naiad Sosp2013
- Felice n2 2013 PDF
- Saharon Shelah and Joel Spencer- Can You Feel the Double Jump
- Mathematical Modelling Summary
- Asymptotic Bounds on Differential Probabilities
- lesson plan c final
- Sem 3 Time Table
- FIND_BADI
- CV-JuanCarlos_GonzAlezChacOn.pdf
- Function y

You are on page 1of 4

Question 1

Let G be a circular directed weighted graph with n nodes (n being the amount

of gas stations), s.t. the sum of all weights is exactly 0.

We can correspond each gas station to a node such that:

• each two nodes are neighbours i their matching gas stations are neigh-

bours

• the weight of a node is the distance which could be travelled with the gas

in the station less the length of the road to the next station

X

∃e ∈ G s.t. ∀e0 ∈ G : w (e? ) ≥ 0

e? ∈[e,e0 ]

where w is the weight function and [e, e0 ] is the (unanimously dened) simple

0

line between e and e.

Let us assume that no such e exists, thus that

X

∀e ∈ G : ∃e0 ∈ G s.t w (e? ) < 0

e? ∈[e,e0 ]

For the simplicity of the proof well say that e is negatively distant from e0 .

Let e0 ∈ G be any node, according to our assumption there is an e1 which is

negatively distant from e0 , and an e2 which is negatively distant from e1 and

so on.

Let us create a succession of n+1 such nodes, since there are only n gas stations,

we know that ∃i, j s.t. i 6= j and ei = ej .

1

Thus the succession (ei , ..., ej ) starts and ends at the same place, and let us

assume it goes over the entire circle k times, thus, the total weight traversed

along this succession is

X

k w(e)

e∈G

X X X X

k w(e) = w (e? ) + ... + w (e? ) < 0 =⇒ w(e) < 0

e∈G e? ∈[ei ,ei+1 ] e? ∈[ej−1 ,ej ] e∈G

Question 2

I suggest this algorithm (which I like to call a reverse Kruskal):

• Go over the edges in that order, and remove it from the graph i it doesn't

divide it into two connectivity components (could be checked in o(|E|))

Correctness proof :

First we must prove that RK indeed returns a tree. The constraints promise

that the output graph is simply connected.

Let us assume that the output contains a circle, and let us denote vj as the

heaviest edge in the circle. Since vj is the rst edge traversed by RK, it's still

containt in a circle, which means removing it will not divide the graph into

two connectivity components, thus having the algorithm remove it, which is a

contradiction.

This proves the output is indeed a spanning tree, let us prove that it has a

minimal maximal edge.

The correctness is trivial in case removing a1 (or any ai s.t. w(ai ) = w(a1 ))

divides the graph into two connectivity components, as a1 (or one of it's dopel-

gangers) must stay thus making any spanning tree a solution.

Assuming that is not the case, let us denote a solution as the ordered set of

edges removed from the graph, and denote the output of our algorithm as RK .

Let B be the set of optimal solutions and let S ∈ B , there is a maximal j s.t.

∀j ≤ i : vj ∈ S , assuming that RK is not optimal means that there exists a

minimal j ≤ i s.t. vj ∈

/ RK .

2

But since S is a solution we know that after removing v1 , ..., vj−1 from G, we get

a connected graph, and furthermore, since vj ∈ S we know that G − {v1 , ..., vj }

is still connected.

Hence, after removing the edges {v1 , ..., vj−1 } RK would remove vj , proving

that vj ∈ RK , in contradiction.

Question 3

Let us consider a spanning tree of G, and let v∈G be a leaf in that tree.

doesn't contain v , and by proxy it doesn't contain any of the edges it's connected

to.

Thus, removing v and all if it's edges, doesn't harm the connectivity of the

graph.

Question 4

• Go over each of the numbers in the array from x1 to xn , if the current

number isn't contained in any segment add it to the output set.

Proof of correctness:

Since the algorithm will add any number not yet covered it's obvious that the

output covers all numbers in the array.

Let B be a set of optimal solutions, and let us assume that A∈

/ B.

The assumption implies that the optimal solution is of size m < k.

Let j be the maximal value such that ∃S ∈ B s.t. {y1 , ..., yj } ⊂ S , thus S =

{y1 , ..., yj , cj+1 , ..., cm }.

Let us denote by xl the minimal element of the input which isn't contained in

any of the segments described by {y1 , ..., yj }.

From the correctness of the algorithms we know that xl ∈ [cj+1 , cj+1 + 1] and

xl ∈ [yj+1 , yj+1 + 1].

But if we examine the elements larger than xl which are contained in the same

segments, we realize that in case of A they are all contained in [xi , yj+1 + 1] and

in case of S they are all contained in [xi , cj+1 + 1].

But from the denition of our algorithm we get that xi = cj+1 thus [xi , yj+1 +

1] ⊆ [xi , cj+1 + 1] (as the length of the rightmost segment is 1, which is the

maximal length, and they both have the same starting point).

3

This proves that {y1 , ..., yj+1 , cj+2 , ..., cm } as also a solution, in contradiction

with j being maximal.

- 10.1.1.113.5469Uploaded bynurlubek
- Sudoku.txtUploaded byram
- Edmond's MatchingUploaded byking_bodontee
- SchedulingUploaded byapi-3844034
- Minimum Spanning TreesUploaded byCharanjeev Singh
- Graph TheoryUploaded bySatish Yadav
- 10.1.1.50Uploaded bylina62
- Pajek - Analysis & Visualization of Large NetworksUploaded byElder Futhark
- 2_-_Limits.docxUploaded byhamood21
- Ada Lab Manual-rvceUploaded byJulie Gallagher
- Naiad Sosp2013Uploaded bykracha82
- Felice n2 2013 PDFUploaded byHeidi
- Saharon Shelah and Joel Spencer- Can You Feel the Double JumpUploaded byHutsDM
- Mathematical Modelling SummaryUploaded byElizabeth Harris
- Asymptotic Bounds on Differential ProbabilitiesUploaded byLuke O'Connor
- lesson plan c finalUploaded byapi-241054379
- Sem 3 Time TableUploaded bySoubhagya Satapathy
- FIND_BADIUploaded byregis0009
- CV-JuanCarlos_GonzAlezChacOn.pdfUploaded byJuan Carlos González
- Function yUploaded byVerdy A. Koehuan
- Faculty Loading for 1st Trimester 16-17Uploaded byジュエル セインツ
- IT NY 04a Worksheet on StatisticsUploaded byyones
- Of Biz Selenium x Ml IntroUploaded byFelipe Barraza
- Excel Sheet for CGPA Calculator BE CSE R2013 Anna University Affiliated CollegesUploaded bykarthick103
- Cognizant OpeningUploaded byGourab Sarkar
- Geolocation PrivacyUploaded byJessica Smith
- verilab_dvcon2012_uvm_cooper.pdfUploaded byPriyanka Roy
- Othello PlayerUploaded byAnonymous fA8RUdH
- File 1157Uploaded byBinay K Srivastawa
- k Means ExampleUploaded byRicardo Herrera

- Course Material 1Uploaded byashok_bbsr
- Permutations, Combination and Binomial TheoremUploaded byyrazs8021
- 2015_MA3T2Uploaded byJnaneswar Reddy
- Library GenesisUploaded byEzie Neill Farro
- astarsearchUploaded bydataminingsingh1
- AI_All_Exercises.docxUploaded bybach khong
- Coco 4Uploaded byBarun Bansal
- CLASS_XUploaded byAdarsh Raj
- Bachelor of Computer Science (Computer Networking)Uploaded byszhual
- Bin PackingUploaded byMayank Gupta
- Binomial TheoremUploaded byJhon Harrison
- BIST2Uploaded byRishi Raj Rathore
- Spectra of Graph by HaemersUploaded bybalamaths
- IntergerArithmeticUploaded byArham Jain
- Shortest PathUploaded bySubrahmanyam Pendyala
- Mod 1,2,3 TestUploaded bySowjanya Gudimetla
- P&CUploaded bySupratim Singh Dev
- Chapter 7Uploaded byGaurav Singh
- What is Finite MathUploaded byRichardZoembelo
- math review unit 3 hwUploaded byapi-233210734
- RSAmaximaUploaded byjoaquin murgade
- Error ControlUploaded byPythagoras
- S17 CS 101 Exam 2Uploaded byua student
- 2017Fall_SyllabusUploaded byPerry Raskin
- Eight Hateful SequencesUploaded byPradyumnaSadgir
- Sat Math Vocabulary QuizUploaded byMohamed Issam
- General CS.txtUploaded byahmad
- ChecksumUploaded bybtap89
- NH.pdfUploaded byRedmi Ken
- A Note on Path Signed DiGraphsUploaded byDon Hass