SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
BLG 336E – Analysis of Algorithms II
Practice Session 2
Atakan Aral
Istanbul Technical University – Department of Computer Engineering
18.03.2014
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Outline
1 Introduction
2 Coffee Shop
Problem
Solution
3 Street Lights
Problem
Solution
4 MST and Shortest Path
True or False?
5 Quiz Solution
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Greedy Algorithm
An algorithm that builds a solution in small steps, choosing a
decision at each step myopically [=locally, not considering what
may happen ahead] to optimize some underlying criterion.
Produces optimum solution for some problems.
Minimum spanning tree
Single-source shortest paths
Huffman trees
Produces good aproximate solutions for some other
problems.
NP-Complete problems such as graph coloring
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Problem
You own a coffe shop that has n customers.
It takes ti minutes to prepare coffee for the ith customer.
ith customer’s value for you (i.e. how frequent s/he comes
to your shop) is vi.
If you start preparing coffee for the ith customer at time si,
you ïŹnish at fi = si + ti.
All customers arrive at the same time.
You can prepare one coffee at a time.
There is no gap after you ïŹnish one coffee and start
another.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Problem
You need to design an algorithm.
Input: n, ti, vi
Output: A schedule (i.e. ordering of customer reqests)
Aim: Minimize wait time especially for valued customers
Minimize :
n
i=1
fi ∗ vi (1)
What is the time complexity of your algorithm?
Run your algorithm for a sample input.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
input : t[], v[], n
1 for i ← 1 to n do
2 w[i, 1] ← v[i]/t[i]; // weight of each customer
3 w[i, 2] ← i;
4 sort(w, dec, 1);
5 t ← 0;
6 cost ← 0;
7 for j ← 1 to n do
8 schedule[j] ← w[j, 2];
9 f[j] ← t + t[schedule[j]];
10 t ← f[j];
11 cost ← cost + f[schedule[j]] ∗ v[schedule[j]];
12 return schedule, f, cost
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
Both for loops take O(n) time.
Complexity of the algorithm depends on sort method.
Typically O(nlogn)
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
Input:
t1 = 2, t2 = 3, t3 = 1
v1 = 10, v2 = 2, v3 = 1
Output:
Weights = 5, 0.67, 1
Schedule: 1, 3, 2
Finish times: 2, 3, 6
Cost: 2*10 + 3*1 + 6*2 = 35
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Problem
Local goverment wants to reduce operating costs of road
lighting.
Not every road will be illuminated at night.
For safety, there will be at least one illuminated path
between all junctions.
Suggest an algorithm to optimize the road lighting
What is the maximum saving without endangering the
citizens?
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Problem
Input contains the junctions and the roads connecting them
As well as, the cost of illuminating each road.
File format is as follows:
7 11
0 1 7
0 3 5
1 2 8
1 3 9
1 4 7
2 4 5
3 4 15
3 5 6
4 5 8
4 6 9
5 6 11
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
g
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
Solution
3 4
1 2
5
6
5
9
11
0
6
8
5
8
9 7
15
7
Total cost: 90 – Optimized cost: 39 – Saving: 51
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
True or False?
Let G be an arbitrary connected, undirected graph with a
positive distinct cost c(e) on every edge e.
Let T be a MST of G. If we replace edge cost c(e) with
c(e) ∗ c(e) , T must still be MST for G.
Same is valid for c(e) + 5.
It is also valid if negative costs are allowed.
2 4
3
MST depends only on the order of the costs, actual values
are not important as long as order is the same.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
True or False?
Let G be an arbitrary connected, directed graph with a
positive cost c(e) on every edge e.
Let P be the shortest path between node s and node t in
G. If we replace edge cost c(e) with c(e)2, P must still be
shortest path between node s and node t in G.
Same is valid for c(e) + 5.
e
t
2
s
2
3
e
t
2
s
2
5
For shortest paths, actual values of the costs do matter.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
True or False?
Let G be an arbitrary connected, directed graph with cost
c(e) on every edge e.
Dijkstra algorithm ïŹnds the correct solution if some edges
have negative costs.
There always exists a solution even if Dijkstra algorithm
cannot ïŹnd it.
e
t
12
s
-5
10
e
t
5
s
6
10
f3
-9
There is no solution for graphs with negative cycles.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II
Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution
s → BLG101E → BLG102E → BLG201E
BLG101E → BLG301E → BLG305E
BLG102E → BLG303E
BLG201E → BLG301E
BLG202E → BLG301E
BLG301E → BLG305E
BLG303E
BLG305E → BLG202E
1 Draw the graph G, showing its nodes and directed edges.
2 Is this graph a DAG (directed acyclic graph)? Give the
reason for your answer.
3 If G is not a DAG, how can you transform it into a DAG?
Which operation is required?
4 Using the DAG course graph, produce a course program
for a student with the minimum number of semesters.
Atakan Aral Istanbul Technical University – Department of Computer Engineering
BLG 336E – Analysis of Algorithms II

Weitere Àhnliche Inhalte

Was ist angesagt?

An Extensive Literature Review on Reversible Arithmetic and Logical Unit
An Extensive Literature Review on Reversible Arithmetic and Logical UnitAn Extensive Literature Review on Reversible Arithmetic and Logical Unit
An Extensive Literature Review on Reversible Arithmetic and Logical UnitIRJET Journal
 
Optimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGAOptimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGADr. Pushpa Kotipalli
 
Reversible code converter
Reversible code converterReversible code converter
Reversible code converterRakesh kumar jha
 
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...Wei Lu
 
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERS
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERSOPTIMIZED REVERSIBLE VEDIC MULTIPLIERS
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERSUday Prakash
 
Commutative Short Circuit Operators
Commutative Short Circuit OperatorsCommutative Short Circuit Operators
Commutative Short Circuit OperatorsEdward Willink
 
Design and implementation of low power
Design and implementation of low powerDesign and implementation of low power
Design and implementation of low powerSurendra Bommavarapu
 
Relaxed Parsing of Regular Approximations of String-Embedded Languages
Relaxed Parsing of Regular Approximations of String-Embedded LanguagesRelaxed Parsing of Regular Approximations of String-Embedded Languages
Relaxed Parsing of Regular Approximations of String-Embedded LanguagesSemyon Grigorev
 
Matlab Projects for Electrical Students
Matlab Projects for Electrical StudentsMatlab Projects for Electrical Students
Matlab Projects for Electrical StudentsPhdtopiccom
 
Ieee project reversible logic gates by_amit
Ieee project reversible logic gates  by_amitIeee project reversible logic gates  by_amit
Ieee project reversible logic gates by_amitAmith Bhonsle
 
Efficient Design of Reversible Multiplexers with Low Quantum Cost
Efficient Design of Reversible Multiplexers with Low Quantum CostEfficient Design of Reversible Multiplexers with Low Quantum Cost
Efficient Design of Reversible Multiplexers with Low Quantum CostIJERA Editor
 
A General Framework for Electronic Circuit Verification
A General Framework for Electronic Circuit VerificationA General Framework for Electronic Circuit Verification
A General Framework for Electronic Circuit VerificationIRJET Journal
 
2-bit comparator
2-bit comparator2-bit comparator
2-bit comparatorIslam Adel
 
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulation
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulationModelica Tutorial with PowerSystems: A tutorial for Modelica simulation
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulationæ™ș擉 ä»Šè„ż
 
Convolution using Scilab
Convolution using ScilabConvolution using Scilab
Convolution using Scilabsachin achari
 
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...IJERA Editor
 

Was ist angesagt? (20)

08. graph traversal
08. graph traversal08. graph traversal
08. graph traversal
 
An Extensive Literature Review on Reversible Arithmetic and Logical Unit
An Extensive Literature Review on Reversible Arithmetic and Logical UnitAn Extensive Literature Review on Reversible Arithmetic and Logical Unit
An Extensive Literature Review on Reversible Arithmetic and Logical Unit
 
Optimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGAOptimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGA
 
Reversible code converter
Reversible code converterReversible code converter
Reversible code converter
 
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...
Refutations on "Debunking the Myths of Influence Maximization: An In-Depth Be...
 
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERS
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERSOPTIMIZED REVERSIBLE VEDIC MULTIPLIERS
OPTIMIZED REVERSIBLE VEDIC MULTIPLIERS
 
Commutative Short Circuit Operators
Commutative Short Circuit OperatorsCommutative Short Circuit Operators
Commutative Short Circuit Operators
 
Signal flow graph
Signal flow graphSignal flow graph
Signal flow graph
 
Design and implementation of low power
Design and implementation of low powerDesign and implementation of low power
Design and implementation of low power
 
Relaxed Parsing of Regular Approximations of String-Embedded Languages
Relaxed Parsing of Regular Approximations of String-Embedded LanguagesRelaxed Parsing of Regular Approximations of String-Embedded Languages
Relaxed Parsing of Regular Approximations of String-Embedded Languages
 
Reversible Logic Gate
Reversible Logic GateReversible Logic Gate
Reversible Logic Gate
 
matlab 10
matlab 10matlab 10
matlab 10
 
Matlab Projects for Electrical Students
Matlab Projects for Electrical StudentsMatlab Projects for Electrical Students
Matlab Projects for Electrical Students
 
Ieee project reversible logic gates by_amit
Ieee project reversible logic gates  by_amitIeee project reversible logic gates  by_amit
Ieee project reversible logic gates by_amit
 
Efficient Design of Reversible Multiplexers with Low Quantum Cost
Efficient Design of Reversible Multiplexers with Low Quantum CostEfficient Design of Reversible Multiplexers with Low Quantum Cost
Efficient Design of Reversible Multiplexers with Low Quantum Cost
 
A General Framework for Electronic Circuit Verification
A General Framework for Electronic Circuit VerificationA General Framework for Electronic Circuit Verification
A General Framework for Electronic Circuit Verification
 
2-bit comparator
2-bit comparator2-bit comparator
2-bit comparator
 
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulation
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulationModelica Tutorial with PowerSystems: A tutorial for Modelica simulation
Modelica Tutorial with PowerSystems: A tutorial for Modelica simulation
 
Convolution using Scilab
Convolution using ScilabConvolution using Scilab
Convolution using Scilab
 
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...
Design of High speed Low Power Reversible Vedic multiplier and Reversible Div...
 

Andere mochten auch

Ang kuwento ni mabuti
Ang kuwento ni mabutiAng kuwento ni mabuti
Ang kuwento ni mabutiMildred Datu
 
C++ class 12 cbse quiz programming (Compiled using Turbo C++)
C++ class 12 cbse quiz programming (Compiled using Turbo C++)C++ class 12 cbse quiz programming (Compiled using Turbo C++)
C++ class 12 cbse quiz programming (Compiled using Turbo C++)Adarsh Pandit
 
Digital citizenship ~ presentation for schools (oct 2012)
Digital citizenship ~ presentation for schools (oct 2012)Digital citizenship ~ presentation for schools (oct 2012)
Digital citizenship ~ presentation for schools (oct 2012)Stephen Carrick-Davies
 
The Quiz Quiz Game
The Quiz Quiz GameThe Quiz Quiz Game
The Quiz Quiz Gamenickmaster5001
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-CStephen Gilmore
 
Digital Citizenship
Digital CitizenshipDigital Citizenship
Digital CitizenshipKati W
 
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)ihsankallai
 
Technical Quiz KAINOTOMIA
Technical Quiz KAINOTOMIATechnical Quiz KAINOTOMIA
Technical Quiz KAINOTOMIAAmal Augustine
 
Computer Quiz (August 2013)
Computer Quiz (August 2013)Computer Quiz (August 2013)
Computer Quiz (August 2013)Soham Banerjee
 
Maikling Kuwento ni Mabuti, gabay sa pagbasa
Maikling Kuwento ni Mabuti, gabay sa pagbasaMaikling Kuwento ni Mabuti, gabay sa pagbasa
Maikling Kuwento ni Mabuti, gabay sa pagbasaNeri Zara
 
Picture Quiz ppt
Picture Quiz pptPicture Quiz ppt
Picture Quiz pptChanakya Karra
 
Picture connection 2
Picture connection 2Picture connection 2
Picture connection 2Pritam Ghoshal
 

Andere mochten auch (17)

Ang kuwento ni mabuti
Ang kuwento ni mabutiAng kuwento ni mabuti
Ang kuwento ni mabuti
 
CPP Quiz
CPP QuizCPP Quiz
CPP Quiz
 
C++ class 12 cbse quiz programming (Compiled using Turbo C++)
C++ class 12 cbse quiz programming (Compiled using Turbo C++)C++ class 12 cbse quiz programming (Compiled using Turbo C++)
C++ class 12 cbse quiz programming (Compiled using Turbo C++)
 
Digital citizenship ~ presentation for schools (oct 2012)
Digital citizenship ~ presentation for schools (oct 2012)Digital citizenship ~ presentation for schools (oct 2012)
Digital citizenship ~ presentation for schools (oct 2012)
 
Quiz show
Quiz showQuiz show
Quiz show
 
The Quiz Quiz Game
The Quiz Quiz GameThe Quiz Quiz Game
The Quiz Quiz Game
 
Quick quiz on Objective-C
Quick quiz on Objective-CQuick quiz on Objective-C
Quick quiz on Objective-C
 
Digital Citizenship
Digital CitizenshipDigital Citizenship
Digital Citizenship
 
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)
IT QUIZ(KOZHIKODE SUB DISTRICT UP LEVEL)
 
Technical Quiz KAINOTOMIA
Technical Quiz KAINOTOMIATechnical Quiz KAINOTOMIA
Technical Quiz KAINOTOMIA
 
Computer Quiz (August 2013)
Computer Quiz (August 2013)Computer Quiz (August 2013)
Computer Quiz (August 2013)
 
Maikling Kuwento ni Mabuti, gabay sa pagbasa
Maikling Kuwento ni Mabuti, gabay sa pagbasaMaikling Kuwento ni Mabuti, gabay sa pagbasa
Maikling Kuwento ni Mabuti, gabay sa pagbasa
 
IT Quiz
IT QuizIT Quiz
IT Quiz
 
Visual round Quiz
Visual round QuizVisual round Quiz
Visual round Quiz
 
Picture Quiz ppt
Picture Quiz pptPicture Quiz ppt
Picture Quiz ppt
 
Picture connection 2
Picture connection 2Picture connection 2
Picture connection 2
 
Chain sling
Chain slingChain sling
Chain sling
 

Ähnlich wie MST Shortest Path Coffee Shop Lighting Algorithm Quiz

Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3AtakanAral
 
Tte 451 operations research fall 2021 part 2
Tte 451  operations research   fall 2021   part 2Tte 451  operations research   fall 2021   part 2
Tte 451 operations research fall 2021 part 2Wael ElDessouki
 
Ieee project reversible logic gates by_amit
Ieee project reversible logic gates  by_amitIeee project reversible logic gates  by_amit
Ieee project reversible logic gates by_amitAmith Bhonsle
 
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...IJERA Editor
 
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...PROFIBUS and PROFINET InternationaI - PI UK
 
Design and simulation of single phase five-level symmetrical cascaded h-bridg...
Design and simulation of single phase five-level symmetrical cascaded h-bridg...Design and simulation of single phase five-level symmetrical cascaded h-bridg...
Design and simulation of single phase five-level symmetrical cascaded h-bridg...Asoka Technologies
 
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATES
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATESOPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATES
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATESVLSICS Design
 
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...Voica Gavrilut
 
Data Structures and Algorithm - Week 8 - Minimum Spanning Trees
Data Structures and Algorithm - Week 8 - Minimum Spanning TreesData Structures and Algorithm - Week 8 - Minimum Spanning Trees
Data Structures and Algorithm - Week 8 - Minimum Spanning TreesFerdin Joe John Joseph PhD
 
Area-Delay Efficient Binary Adders in QCA
Area-Delay Efficient Binary Adders in QCAArea-Delay Efficient Binary Adders in QCA
Area-Delay Efficient Binary Adders in QCAIJERA Editor
 
An Area Efficient and High Speed Reversible Multiplier Using NS Gate
An Area Efficient and High Speed Reversible Multiplier Using NS GateAn Area Efficient and High Speed Reversible Multiplier Using NS Gate
An Area Efficient and High Speed Reversible Multiplier Using NS GateIJERA Editor
 
Cost Efficient Design of Reversible Adder Circuits for Low Power Applications
Cost Efficient Design of Reversible Adder Circuits for Low Power ApplicationsCost Efficient Design of Reversible Adder Circuits for Low Power Applications
Cost Efficient Design of Reversible Adder Circuits for Low Power ApplicationsVIT-AP University
 
Mb0048 operations research winter 2014
Mb0048 operations research winter 2014Mb0048 operations research winter 2014
Mb0048 operations research winter 2014Mba Assignments
 
A High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADCA High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADCPushpak Dagade
 
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...IJERA Editor
 
Efficient Design of Reversible Sequential Circuit
Efficient Design of Reversible Sequential CircuitEfficient Design of Reversible Sequential Circuit
Efficient Design of Reversible Sequential CircuitIOSR Journals
 

Ähnlich wie MST Shortest Path Coffee Shop Lighting Algorithm Quiz (20)

Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3Analysis of Algorithms II - PS3
Analysis of Algorithms II - PS3
 
Tte 451 operations research fall 2021 part 2
Tte 451  operations research   fall 2021   part 2Tte 451  operations research   fall 2021   part 2
Tte 451 operations research fall 2021 part 2
 
Unit i
Unit iUnit i
Unit i
 
Ieee project reversible logic gates by_amit
Ieee project reversible logic gates  by_amitIeee project reversible logic gates  by_amit
Ieee project reversible logic gates by_amit
 
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...
Implementation and Comparison of Efficient 16-Bit SQRT CSLA Using Parity Pres...
 
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...
Industrial control cases with MATLAB code in PLCs, using PROFINET's "oversamp...
 
Design and simulation of single phase five-level symmetrical cascaded h-bridg...
Design and simulation of single phase five-level symmetrical cascaded h-bridg...Design and simulation of single phase five-level symmetrical cascaded h-bridg...
Design and simulation of single phase five-level symmetrical cascaded h-bridg...
 
Unit i
Unit iUnit i
Unit i
 
C046051216
C046051216C046051216
C046051216
 
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATES
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATESOPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATES
OPTIMIZED MULTIPLIER USING REVERSIBLE MULTICONTROL INPUT TOFFOLI GATES
 
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...
Fault-tolerant topology and routing synthesis for IEEE time-sensitive network...
 
Data Structures and Algorithm - Week 8 - Minimum Spanning Trees
Data Structures and Algorithm - Week 8 - Minimum Spanning TreesData Structures and Algorithm - Week 8 - Minimum Spanning Trees
Data Structures and Algorithm - Week 8 - Minimum Spanning Trees
 
S4102152159
S4102152159S4102152159
S4102152159
 
Area-Delay Efficient Binary Adders in QCA
Area-Delay Efficient Binary Adders in QCAArea-Delay Efficient Binary Adders in QCA
Area-Delay Efficient Binary Adders in QCA
 
An Area Efficient and High Speed Reversible Multiplier Using NS Gate
An Area Efficient and High Speed Reversible Multiplier Using NS GateAn Area Efficient and High Speed Reversible Multiplier Using NS Gate
An Area Efficient and High Speed Reversible Multiplier Using NS Gate
 
Cost Efficient Design of Reversible Adder Circuits for Low Power Applications
Cost Efficient Design of Reversible Adder Circuits for Low Power ApplicationsCost Efficient Design of Reversible Adder Circuits for Low Power Applications
Cost Efficient Design of Reversible Adder Circuits for Low Power Applications
 
Mb0048 operations research winter 2014
Mb0048 operations research winter 2014Mb0048 operations research winter 2014
Mb0048 operations research winter 2014
 
A High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADCA High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADC
 
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
 
Efficient Design of Reversible Sequential Circuit
Efficient Design of Reversible Sequential CircuitEfficient Design of Reversible Sequential Circuit
Efficient Design of Reversible Sequential Circuit
 

Mehr von AtakanAral

Subgraph Matching for Resource Allocation in the Federated Cloud Environment
Subgraph Matching for Resource Allocation in the Federated Cloud EnvironmentSubgraph Matching for Resource Allocation in the Federated Cloud Environment
Subgraph Matching for Resource Allocation in the Federated Cloud EnvironmentAtakanAral
 
Quality of Service Channelling for Latency Sensitive Edge Applications
Quality of Service Channelling for Latency Sensitive Edge ApplicationsQuality of Service Channelling for Latency Sensitive Edge Applications
Quality of Service Channelling for Latency Sensitive Edge ApplicationsAtakanAral
 
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...AtakanAral
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...AtakanAral
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...AtakanAral
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...AtakanAral
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...AtakanAral
 
Software Engineering - RS4
Software Engineering - RS4Software Engineering - RS4
Software Engineering - RS4AtakanAral
 
Software Engineering - RS3
Software Engineering - RS3Software Engineering - RS3
Software Engineering - RS3AtakanAral
 
Software Engineering - RS2
Software Engineering - RS2Software Engineering - RS2
Software Engineering - RS2AtakanAral
 
Software Engineering - RS1
Software Engineering - RS1Software Engineering - RS1
Software Engineering - RS1AtakanAral
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]AtakanAral
 
Improving Resource Utilization in Cloud using Application Placement Heuristics
Improving Resource Utilization in Cloud using Application Placement HeuristicsImproving Resource Utilization in Cloud using Application Placement Heuristics
Improving Resource Utilization in Cloud using Application Placement HeuristicsAtakanAral
 
Analysis of Algorithms - 5
Analysis of Algorithms - 5Analysis of Algorithms - 5
Analysis of Algorithms - 5AtakanAral
 
Analysis of Algorithms - 3
Analysis of Algorithms - 3Analysis of Algorithms - 3
Analysis of Algorithms - 3AtakanAral
 
Analysis of Algorithms - 2
Analysis of Algorithms - 2Analysis of Algorithms - 2
Analysis of Algorithms - 2AtakanAral
 
Analysis of Algorithms - 1
Analysis of Algorithms - 1Analysis of Algorithms - 1
Analysis of Algorithms - 1AtakanAral
 
Mobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web DataMobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web DataAtakanAral
 

Mehr von AtakanAral (18)

Subgraph Matching for Resource Allocation in the Federated Cloud Environment
Subgraph Matching for Resource Allocation in the Federated Cloud EnvironmentSubgraph Matching for Resource Allocation in the Federated Cloud Environment
Subgraph Matching for Resource Allocation in the Federated Cloud Environment
 
Quality of Service Channelling for Latency Sensitive Edge Applications
Quality of Service Channelling for Latency Sensitive Edge ApplicationsQuality of Service Channelling for Latency Sensitive Edge Applications
Quality of Service Channelling for Latency Sensitive Edge Applications
 
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...
Resource Mapping Optimization for Distributed Cloud Services - PhD Thesis Def...
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Progres...
 
Software Engineering - RS4
Software Engineering - RS4Software Engineering - RS4
Software Engineering - RS4
 
Software Engineering - RS3
Software Engineering - RS3Software Engineering - RS3
Software Engineering - RS3
 
Software Engineering - RS2
Software Engineering - RS2Software Engineering - RS2
Software Engineering - RS2
 
Software Engineering - RS1
Software Engineering - RS1Software Engineering - RS1
Software Engineering - RS1
 
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]
Modeling and Optimization of Resource Allocation in Cloud [PhD Thesis Proposal]
 
Improving Resource Utilization in Cloud using Application Placement Heuristics
Improving Resource Utilization in Cloud using Application Placement HeuristicsImproving Resource Utilization in Cloud using Application Placement Heuristics
Improving Resource Utilization in Cloud using Application Placement Heuristics
 
Analysis of Algorithms - 5
Analysis of Algorithms - 5Analysis of Algorithms - 5
Analysis of Algorithms - 5
 
Analysis of Algorithms - 3
Analysis of Algorithms - 3Analysis of Algorithms - 3
Analysis of Algorithms - 3
 
Analysis of Algorithms - 2
Analysis of Algorithms - 2Analysis of Algorithms - 2
Analysis of Algorithms - 2
 
Analysis of Algorithms - 1
Analysis of Algorithms - 1Analysis of Algorithms - 1
Analysis of Algorithms - 1
 
Mobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web DataMobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web Data
 

KĂŒrzlich hochgeladen

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessEnvertis Software Solutions
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy LĂłpez
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 

KĂŒrzlich hochgeladen (20)

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 

MST Shortest Path Coffee Shop Lighting Algorithm Quiz

  • 1. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution BLG 336E – Analysis of Algorithms II Practice Session 2 Atakan Aral Istanbul Technical University – Department of Computer Engineering 18.03.2014 Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 2. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Outline 1 Introduction 2 Coffee Shop Problem Solution 3 Street Lights Problem Solution 4 MST and Shortest Path True or False? 5 Quiz Solution Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 3. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Greedy Algorithm An algorithm that builds a solution in small steps, choosing a decision at each step myopically [=locally, not considering what may happen ahead] to optimize some underlying criterion. Produces optimum solution for some problems. Minimum spanning tree Single-source shortest paths Huffman trees Produces good aproximate solutions for some other problems. NP-Complete problems such as graph coloring Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 4. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Problem You own a coffe shop that has n customers. It takes ti minutes to prepare coffee for the ith customer. ith customer’s value for you (i.e. how frequent s/he comes to your shop) is vi. If you start preparing coffee for the ith customer at time si, you ïŹnish at fi = si + ti. All customers arrive at the same time. You can prepare one coffee at a time. There is no gap after you ïŹnish one coffee and start another. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 5. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Problem You need to design an algorithm. Input: n, ti, vi Output: A schedule (i.e. ordering of customer reqests) Aim: Minimize wait time especially for valued customers Minimize : n i=1 fi ∗ vi (1) What is the time complexity of your algorithm? Run your algorithm for a sample input. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 6. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution input : t[], v[], n 1 for i ← 1 to n do 2 w[i, 1] ← v[i]/t[i]; // weight of each customer 3 w[i, 2] ← i; 4 sort(w, dec, 1); 5 t ← 0; 6 cost ← 0; 7 for j ← 1 to n do 8 schedule[j] ← w[j, 2]; 9 f[j] ← t + t[schedule[j]]; 10 t ← f[j]; 11 cost ← cost + f[schedule[j]] ∗ v[schedule[j]]; 12 return schedule, f, cost Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 7. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution Both for loops take O(n) time. Complexity of the algorithm depends on sort method. Typically O(nlogn) Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 8. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution Input: t1 = 2, t2 = 3, t3 = 1 v1 = 10, v2 = 2, v3 = 1 Output: Weights = 5, 0.67, 1 Schedule: 1, 3, 2 Finish times: 2, 3, 6 Cost: 2*10 + 3*1 + 6*2 = 35 Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 9. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Problem Local goverment wants to reduce operating costs of road lighting. Not every road will be illuminated at night. For safety, there will be at least one illuminated path between all junctions. Suggest an algorithm to optimize the road lighting What is the maximum saving without endangering the citizens? Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 10. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Problem Input contains the junctions and the roads connecting them As well as, the cost of illuminating each road. File format is as follows: 7 11 0 1 7 0 3 5 1 2 8 1 3 9 1 4 7 2 4 5 3 4 15 3 5 6 4 5 8 4 6 9 5 6 11 Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 11. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 12. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 13. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 14. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 15. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 16. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 g Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 17. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution Solution 3 4 1 2 5 6 5 9 11 0 6 8 5 8 9 7 15 7 Total cost: 90 – Optimized cost: 39 – Saving: 51 Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 18. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution True or False? Let G be an arbitrary connected, undirected graph with a positive distinct cost c(e) on every edge e. Let T be a MST of G. If we replace edge cost c(e) with c(e) ∗ c(e) , T must still be MST for G. Same is valid for c(e) + 5. It is also valid if negative costs are allowed. 2 4 3 MST depends only on the order of the costs, actual values are not important as long as order is the same. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 19. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution True or False? Let G be an arbitrary connected, directed graph with a positive cost c(e) on every edge e. Let P be the shortest path between node s and node t in G. If we replace edge cost c(e) with c(e)2, P must still be shortest path between node s and node t in G. Same is valid for c(e) + 5. e t 2 s 2 3 e t 2 s 2 5 For shortest paths, actual values of the costs do matter. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 20. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution True or False? Let G be an arbitrary connected, directed graph with cost c(e) on every edge e. Dijkstra algorithm ïŹnds the correct solution if some edges have negative costs. There always exists a solution even if Dijkstra algorithm cannot ïŹnd it. e t 12 s -5 10 e t 5 s 6 10 f3 -9 There is no solution for graphs with negative cycles. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II
  • 21. Introduction Coffee Shop Street Lights MST and Shortest Path Quiz Solution s → BLG101E → BLG102E → BLG201E BLG101E → BLG301E → BLG305E BLG102E → BLG303E BLG201E → BLG301E BLG202E → BLG301E BLG301E → BLG305E BLG303E BLG305E → BLG202E 1 Draw the graph G, showing its nodes and directed edges. 2 Is this graph a DAG (directed acyclic graph)? Give the reason for your answer. 3 If G is not a DAG, how can you transform it into a DAG? Which operation is required? 4 Using the DAG course graph, produce a course program for a student with the minimum number of semesters. Atakan Aral Istanbul Technical University – Department of Computer Engineering BLG 336E – Analysis of Algorithms II