midterm1+project - Midterm I Solutions 1 Topological...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Midterm I Solutions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Topological ordering (i) begin for all i N do indegree(i) := 0; for all (i,j) A do indegree(j) := indegree(j) + 1; LIST := ; next := 0; for all i N do if indegree(i) = 0, then LIST := LIST { i }; while LIST do begin select a node i from LIST and delete it; next := next + 1; order(i) := next; for all (i,j) A(i) do begin indegree(j) := indegree(j) – 1; if indegree(j) = 0 then LIST := LIST { j }; end end if next < n then the network contains a directed cycle else the network is acyclic and the order is topological end
Background image of page 2
3 Parts (ii) and (iii) Let N={1,…, n } be topologically ordered Paths[1]={1} Num[1]=1; for i=2 to n do for j=1 to i-1 do Paths[i]={pU{i}: p ϵ Paths[j] and length(p)+cost(j,i) ≤ B } Num[i]=|Paths[i]|
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4
Background image of page 4
5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 3(c) Let N={1,…, n } C={1} for i=2 to n do good=1 while (j ϵ C) and (good) do If {i,j} E good=0 If good C=C U {i}
Background image of page 6
7 Design of a minimum cost fiber optic network Input: An undirected network G=(N,E) with a positive integer weight
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/15/2010 for the course INDUSTRIAL ie513 taught by Professor Zeynephuygur during the Spring '10 term at Bilkent University.

Page1 / 9

midterm1+project - Midterm I Solutions 1 Topological...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online