0 Голоса «за»0 Голоса «против»

Просмотров: 210 стр.This is a sample document of a Programming Homework that was done by our able team. This can serve a guideline to your programming homework of such a kind. Feel free to reach us through https://www.programmingassignmenthelper.com/samples/

Jul 02, 2018

© © All Rights Reserved

PDF, TXT или читайте онлайн в Scribd

This is a sample document of a Programming Homework that was done by our able team. This can serve a guideline to your programming homework of such a kind. Feel free to reach us through https://www.programmingassignmenthelper.com/samples/

© All Rights Reserved

Просмотров: 2

This is a sample document of a Programming Homework that was done by our able team. This can serve a guideline to your programming homework of such a kind. Feel free to reach us through https://www.programmingassignmenthelper.com/samples/

© All Rights Reserved

- Tg Theft - cripto
- Fm.lautenschlager.confpro.dac 3961.1997
- Combinatorial Spacetimes
- Compit_2007_ConferenceProceedings
- An Innovative Method of Die Design and Evaluation of Flow Balance for Thermoplastics Extrusion Profiles
- Two greedy algorithms for a binary quadratically constrained linear program in survey data editing
- HCM540-StaffingAndScheduling-II
- Solution
- AI.pdf
- r5
- Intro Prod Cost Model
- I nternational Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 7
- lec29
- Paper 3
- Generalized Gradient Algorithm
- MSC NASTRAN
- Sing Levar Opt
- Designing Low Energy Buildings Application of A
- ENHANCEMENT OF AVAILABLE TRANSFER CAPABILITY WITH FACTS DEVICE IN COMPETITIVE POWER MARKET
- Cost Optimization of Reinforced Earth Walls

Вы находитесь на странице: 1из 10

com

Go To Code Directly

18.415/6.854 Advanced Algorithms

Problem Set 3

Given c E Rn, c 2 0, n even, find

n

min{cTx: C,,,xi 2 1 VS c {I ,...,n), IS1 = 5,

In class, it was shown that this can be solved by the ellipsoid method because

there is an efficient separation algorithm. However, this problem has a more

straightforward solution.

Develop an algorithm which finds the optimum in O(n logn) time. Prove its

correctness.

Suppose that (x, y, s) is a feasible vector, i.e. x > 0, s > 0,

and we perform one Newton step by solving for Ax, Ay, As:

AAx = O

A ~+AA s =~ 0

Vjj'; XjSj Axjsj + xjA5'j = P

XjSj

I)?

P

Prove that if

!, ) <1

A T Y + s = c , s > 0.

https://www.programmingassignmenthelper.com

iven a directed graph G = (V,E ) and two vertices s and t, we d d like to

3b G

find the maximum number of edge-disjoint paths between s and t (two paths

are edge-disjoint if they don't share an edge). Denote the number of vertices

by n and the number of edges by m.

(a) Argue that this problem can be solved as a m h u m flow problem with

unit capacitia. Explain.

(b) Consider now the mashurn ~ Q proMan

W on directed graphs G = (V,E)

with unit capacity edges .(dthough some of the questions below would also

appIy to the more general case).

Given a feasible flow f,we cm construct the midual network Gf = (V, E!)

where

depending on the case above. Since we are dealing with the unit capwits

case, an the q*'s are 1 and therefore for 0 - 1 flows f (i,e. flows for which

the d u e on any edge is 0 or I),dl residual capwitia wilI be I.

We d&e the distance of .a vertex If(v) as the Iengkh of the shortest path

from s to v in Ep (w for vertices which are not reachable from s in E f ) .

Further, d&e the lmelled residual network as

residual capacities) such that every directed s - t path in El has at least

one saturated edge (i.e. an edge whose fiflow equals the residual capacity].

For a unit capacity graph and a given 0 - 1 flow f, show how we can .find

the leverIIed residual network and a saturatisg flaw in O(m)time.

(c) Prove that if the le~1led reaidual network has no path from s to t (kf (t)=

m),then the fiow f iis mmhum.

Ed] For a flm f,d&e

4 f l = b ($1

saturating flow far f then

fij by gij or decreasing the flow fjiiby gg for e m edge (i, j ) E GI.

(e) Prove that if f is a feasible 0 - 1 flow with distance d = d ( f ) and f * is an

optimum flow, then

and also

(f)

Design a maximum flow algorithm (for unit capacities) which proceeds by

finding a saturating flow repeatedly. Try to optimize its running time.

Using the observations above, you should achieve a running time bounded

by o (min (mn2I3,m3I2)).

(g) Can we now justify that, for 0 - 1 capacities, there is always an optimum

flow that takes values 0 or 1 on every edge?

18.415/6.854 Advanced Algorithms

Given c E Rn , c 2 0, n even, find

min{cTx : xi,,xi 2 1 n

VS c (1,. . . , n), IS1 = 2,

In class, it was shown that this can be solved by the ellipsoid method

because there is an efficient separation algorithm. However, this

problem has a more straightforward solution.

Develop an algorithm which finds the optimum in O ( nlog n) time.

Prove its correctness.

Let

We prove that x E P exactly when x can be written as

First, suppose x satisfies this and consider S of size n/2. Any set A of size

IAl > n / 2 intersects S in at least IAl - n/2 elements, therefore

PSS3-1

Set

and

Now we can optimize over P much more easily. First, observe that for any

optimal solution

otherwise we decrease the coefficients until the equality holds. This won't in-

>

crease the objective function C cixi, since c 0. Therefore an optimal solution

always exists in the convex hull of { p A : IAl > n/2} where

We could evaluate the objective function a t all these points but there are still

too many of them. However, we can notice that for a given k = IAl, the

only candidate for an optimum pa is the set A which contains the k smallest

components of c. Therefore the algorithm is the following:

Sort the components of c and let Ak denote the indices of the k smallest

components of c, for each k > n/2. This takes O(n logn) time.

For each k > n / 2 , calculate sk = CiEAk

ck. This can be done in O ( n )time,

because the sets Ak form a chain and we can use sk to calculate sk+l in

constant time.

Find the smallest value of

The algorithm runs in 0 ( nlog n) time and its correctness follows from the anal-

ysis above.

Suppose that ( x ,y, s ) is a feasible vector, i.e. x > 0, s > 0,

Ax = b,

ATy+s=c

and we perform one Newton step by solving for A x , A y , As:

V X j S j + A x j ~ j+ x j A s j =/l

Prove that if

+ +

then ( x A x , y A y , s + A s ) is a feasible vector for Ax = b, x > 0 and

ATy+s=c,s>O.

The equalities are satisfied directly by the assumptions:

We have to verify the positivity conditions. First we prove that at least one of

+ +

xj A x j , sj A s j is positive. We have xj > 0,sj > 0 and

therefore either xj + Axj or sj + Asj must be positive.

Second, we use the proximity condition:

+ +

which means that xj Axj and sj Asj have the same sign. We know they

can't be negative so they must be positive.

Given a directed graph G = (V, E) and two vertices s and t, we would

like to find the maximum number of edge-disjoint paths between s and

t (two paths are edge-disjoint if they don't share an edge). Denote

the number of vertices by n and the number of edges by m.

(a)

Argue that this problem can be solved as a maximum flow prob-

lem with unit capacities. Explain.

Let F be a union of k edge-disjoint paths from s t o t. We define a flow of

value k in a natural way - an edge gets a flow of value 1 if it is contained

in F and and 0 otherwise. Since each path enters and exits any vertex

(except s and t) the same number of times, flow conservation holds. The

value of the flow is the number of edges in F leaving s (or entering t ) which

is k.

Conversely, let f be the maximum flow with unit capacities. As we shall

prove, there is always a 0 - 1maximum flow, therefore we can assume that

f, is either 0 or 1for each edge. Let

and k be the value of the flow. Then we can decompose F into k edge-

disjoint paths in the following way: We start from s and follow a path

of edges in F until we hit t. (This is possible due to flow conservation.)

When we have found such a path, we remove it from F and consider the

remaining flow of value k - 1. By induction, we find exactly k such paths.

(b)

Consider now the maximum flow problem on directed graphs G =

(V, E) with unit capacity edges. (although some of the questions

below would also apply t o the more general case).

Given a feasible flow f , we can construct the residual network

Gf = (V,Ef) where

Ef = {(i, j) : ((i,j) E E & fq < uij) or ((j,i) E E & fji> 0)).

The residual capacity of an edge (i, j) E Ef is equal t o uij - f i j or

t o fji depending on the case above. Since we are dealing with

the unit capacity case, all the uij's are 1 and therefore for 0 - 1

flows f (i.e. flows for which the value on any edge is 0 or I), all

residual capacities will be 1.

We define the distance of a vertex lf(v) as the length of the short-

est path from s t o v in Ef (cafor vertices which are not reachable

from s in Ef). Further, define the levelled residual network as

and a saturating flow g in Ei as a flow in E; (with capacities

being the residual capacities) such that every directed s - t path

in Elf has at least one saturated edge (i.e. an edge whose flow

equals the residual capacity).

For a unit capacity graph and a given 0 - 1 flow f, show how we

can find the levelled residual network and a saturating flow in

O(m) time.

First, we can find Ef in O(m) time simply by testing each edge and adding

the edge or its reverse to Ef, depending on the current flow. Then we can

label the vertices by If (v) by a breadth-first search from s. This takes time

O(m), also. At the same time we find d(f) as the length of the shortest

path from s to t.

Then, we create E$ by keeping only the edges between successive levels.

Thus all paths between s and t in Ei have length d(f ) . Now we produce

flow g by finding as many edge-disjoint s-t paths as possible. We start with

E' = Ei and we perform a depth-first search from s. If we get stuck, we

backtrack and remove edges on the dead-end branches since these are not

in any s-t path anyway. When we find an s-t path, we set gij = 1 along

that path, and remove it from E'. We continue searching for paths until

E' is empty. We spend a constant time on each edge before it's removed,

which is O(m) time total. When we are done, there is no s-t path in E$

without a saturated edge, otherwise it would still be in E'.

(c) Prove that if the levelled residual network has no path from s t o

t (If ( t )= co), then the flow f is maximum.

Suppose there is a flow f * of greater value. Then f * - f (where the dif-

ference is produced by either decreasing flow along an edge and increasing

flow in the opposite direction) is a feasible flow in the residual network

which has a positive value. This is easy to see because if f; > f i j then

(i,j) appears in Ef and f; - f, 5 uij - fo which is the capacity of this

edge in Ef . If f; < fq then fu > 0 and therefore the opposite edge (j,i)

appears in E f . Also, fi, - f; 5 f i j which is the capacity of (j,i) in E f .

When a non-zero flow exists in Ef , there exists a path from s to t using

only edges in E f . The shortest of these paths would appear in Ef,as well,

which is a contradiction.

(d) For a flow f , define

d(f = If (t)

(the distance from s to t in the residual network). Prove that if

g is a saturating flow for f then

the flow f, by gij or decreasing the flow fji by gij for every edge

(i,j) E Gf.

Consider Ef and the labeling of vertices if (v). For every edge (i, j) of Ef

+

we have that if (j)5 If (i) 1. Since g is a saturating flow in ~ f ,the, only

edges (u, v) which are in Ef+, and not in Ef are such that (v, u) E E;,

which implies that lf (v) = lf (u) - I. In summary, every edge (i, j ) of Ef+,

+

satisfies if (j) 5 If (i) 1 and, furthermore, the edges which are not in

+

Ef actually satisfy the inequality strictly 1 (j) < lf(i) 1. Consider now

+

any path P in Ef+, Adding up l f ( j ) 5 lf(i) 1 over the edges of P, we

get that d ( f ) 5 IPI. Moreover, we can have d(f) = IPI only if all edges

of P also belong to Ef, which is impossible since g is a saturating flow.

Hence, d(f) < lPl and this is true for any path P of Ef+, implying that

d(f ) < d ( f + g).

(e) Prove that if f is a feasible 0 - 1 flow with distance d = d ( f ) and

f * is an optimum flow, then

and also

g = f * - f is a feasible flow in the residual network E f .

Consider s-t cuts Cl, C 2 , ... Cd defined by

There are at most m edges in total and these cuts are disjoint, therefore

Since the value of g cannot be greater than any s-t cut in Ef,

m

value(f*) - value(f) = value(g) 5 -.

d

+

Similarly, define d 1 sets of vertices Vo,V17V2, . . . , Vd:

= {i E V : l f ( i )= k ) .

By double counting,

to Vk-l x Vk. Therefore

proceeds by finding a saturating flow repeatedly. Try to opti-

mize its running time. Using the observations above, you should

achieve a running time bounded by 0(min(mn2l3,m 3I2)).

The algorithm starts with a zero flow f . Then we repeat the following:

Find the levelled residual network ~ l f .

Find a saturating flow g.

a Add g to f , reset the residual network and continue.

Each iteration takes O(m) time. Since d(f) increases every time and it

cannot reach more than n (the maximum possible distance in G), the

running time is clearly bounded by O(mn). However, we can improve this.

Suppose we iterate only d times and our flow after d iterations is f . We

know d ( f ) 2 d, and i f f * is an optimal flow,

number of iterations is bounded by min{y, $). We choose d in order to

optimize our bound. It turns out that the best choice is dl = m1I2 for the

bound based on m and d2 = n2I3for the bound based on n. Thus the total

running time is 0(min{m3I2,mn2I3)).

(g) Can we now justify that, for 0 - 1 capacities, there is always an

optimum flow that takes values 0 or 1 on every edge?

Our algorithm finds a 0 - 1flow and we have a proof of optimality, therefore

there is always a 0 - 1 optimal flow. This justifies our reasoning in part

(a).

- Tg Theft - criptoЗагружено:alex240390
- Fm.lautenschlager.confpro.dac 3961.1997Загружено:ramya2212
- Combinatorial SpacetimesЗагружено:Jeff Pratt
- Compit_2007_ConferenceProceedingsЗагружено:Shanvens Wong
- An Innovative Method of Die Design and Evaluation of Flow Balance for Thermoplastics Extrusion ProfilesЗагружено:Soh Rab
- Two greedy algorithms for a binary quadratically constrained linear program in survey data editingЗагружено:paundpro
- HCM540-StaffingAndScheduling-IIЗагружено:Donna Christine Dotarot
- SolutionЗагружено:Waqas Ahmed
- AI.pdfЗагружено:sudhialamanda
- r5Загружено:Shankar G
- Intro Prod Cost ModelЗагружено:Egeruoh Chigoziri Cyrinus
- I nternational Journal Of Computational Engineering Research (ijceronline.com) Vol. 2 Issue. 7Загружено:International Journal of computational Engineering research (IJCER)
- lec29Загружено:mukesh3021
- Paper 3Загружено:Miguel Acb
- Generalized Gradient AlgorithmЗагружено:mykingboody2156
- MSC NASTRANЗагружено:Jan Scar
- Sing Levar OptЗагружено:Diego Isla
- Designing Low Energy Buildings Application of AЗагружено:Samaa Gamal
- ENHANCEMENT OF AVAILABLE TRANSFER CAPABILITY WITH FACTS DEVICE IN COMPETITIVE POWER MARKETЗагружено:Poornima Tadikonda
- Cost Optimization of Reinforced Earth WallsЗагружено:Anonymous q1gByww
- Gaussian OptimizationЗагружено:Mark Cliffton Badlon
- Tardiness Integer ProgrammingЗагружено:nvcg10
- W6 - System DynamicsЗагружено:AnaaAriiyantoUya
- MITlec08Загружено:Lalo Pato
- Guia de Inicio ArenaЗагружено:Julio Mojica Herazo
- 41Загружено:aria woohoo
- Product Cordiality of Barycentric Subdivision of CnЗагружено:IJRASETPublications
- 148.IJMPERDJUN2019148Загружено:TJPRC Publications
- Sensitivity Analysis Tutorial AnswerЗагружено:Hanuman Karwasra
- OR for ManagersЗагружено:Biswajit Sarma

- Programming Assignment for pointers - Samples 2Загружено:Jack Clark
- Statistics Homework Sample 3Загружено:Jack Clark
- Programming Assignment Sample 4Загружено:Jack Clark
- C Programming LanguageЗагружено:Jack Clark
- Statistics Homework Sample 2 for MatlabЗагружено:Jack Clark
- C ++ Programming Assignment SampleЗагружено:Jack Clark
- SQL ProgrammingЗагружено:Jack Clark
- Java ProgrammingЗагружено:Jack Clark
- STATA Homework SampleЗагружено:Jack Clark
- C Programming Homework Sample.pdfЗагружено:Jack Clark
- Statistics Homework for Matlab 1Загружено:Jack Clark
- Statistics Assignment SampleЗагружено:Jack Clark

- Som Kohonen FuzzyЗагружено:assnad
- Taylch07Загружено:Yat Kunt Chan
- Data Mining Models and Evaluation TechniquesЗагружено:spsberry8
- Lecture 8A Unit Commitment Part 1Загружено:aryo_el06
- Design and Analysis of Algorithms 1Загружено:Lohidas Paila
- Gonzalez Digital Image Processing Google BooksЗагружено:Kate
- speech coding journalЗагружено:eol
- Spectrum of a Digital SignalЗагружено:Mohlala
- Simulink Exercises for _Digital Communications_ A Discrete-Time Approach,_ by M.pdfЗагружено:binesh
- Engg 407 NotesЗагружено:Ameet Rai
- optimization Using Scilab.pdfЗагружено:Miguel Granados
- svm.pptЗагружено:Himanshu Bhatt
- DSP System Toolbox™ Getting Started GuideЗагружено:Khai Huynh
- Matlab Script FileЗагружено:tvr123
- rgpv syllabus it111 data structure-i.pdfЗагружено:satti2628
- A Survey Guide for Brain Tumor Detection Using Various Image Processing Based ApproachesЗагружено:International Journal of Innovative Science and Research Technology
- The Factor & Remainder TheoremЗагружено:wolfretonmaths
- Minimum Spanning Tree(Prim Kruskal)Загружено:Emon Khan
- Levenberg-Marquardt Method for SolvЗагружено:cmfaria
- LAB QNS M.TECH (1)Загружено:calvin
- Direct Sparse and FFEPlus Solvers _ eCAD-Engineering.pdfЗагружено:Avk Sanjeevan
- FFT2 AlgorithmЗагружено:Minh Nhật
- ACCA F2L10 LimitingFactorsЗагружено:Poppi HS
- Data Structure for NEt.pdfЗагружено:Dinesh Bhawnani
- LAB_6_FINALЗагружено:sukeko_sailesh
- DSP matlab for DFT n IIFTЗагружено:deeptakshd
- convolutionЗагружено:Abhishek Kumar
- GRC tutorialЗагружено:Ebenezer Samson
- Motion Estimation in H.264/Avc by 2d Logarithmic Search AlgorithmЗагружено:International Journal for Scientific Research and Development - IJSRD
- OPTIMAL POWER USE SURFACE FOR DESIGN OF WATER DISTRIBUTION SYSTEMS.pdfЗагружено:Mexichem Colombia S.A.S

## Гораздо больше, чем просто документы.

Откройте для себя все, что может предложить Scribd, включая книги и аудиокниги от крупных издательств.

Отменить можно в любой момент.