midterm1+project

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

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

1 Midterm I Solutions

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

View Full Document
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
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]|

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

View Full Document
4
5

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

View Full Document
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}
7 Design of a minimum cost fiber optic network Input: An undirected network G=(N,E) with a positive integer weight

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

View Full Document
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
Ask a homework question - tutors are online