SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
Graph Analytics and Complexity
Questions and Answers
by
Dr.Animesh Chaturvedi
Assistant Professor: LNMIIT Jaipur
Post Doctorate: King’s College London &TheAlanTuring Institute
PhD: IIT Indore
Answers of Fill in the Blank
Answers of Match The Column
Answers of Match The Column
Answers of Fill in the Blank
Answers of Match The Column
Q5
Q5
A5
There could be many ways to answer this question. For example
• CG1: the number of incoming edges to that function, the priority of
calling a procedures, number of variables function B inherits from
function A, time required to call, cost of calling a procedure by a caller
procedure, time or duration of call or request between two
procedures, etc.
• WN2: frequency of the word, memory required to store a word, cost
we must spend in order to connect, number of conjunction between
words.
A5
MST3) Average-MST(G1, G2, G3)
n = size of G1
M1 = Prim's-MST(G1)
M2 = Prim's-MST(G2)
M3 = Prim's-MST(G3)
G[n, n] <- Graph
for i=1 to n
for j=1 to n
if M1[i][j]==1 or M2[i][j]==1 or M3[i][j]==1
G[i,j] = 1
else
G[i,j] = 0
return Prim's-MST(G)
A5
SP4) Average-SSSP(G1, G2, G3)
n = size of G1
D1 = Dijkstra's-SP(G1)
D2 = Dijkstra's-SP(G2)
D3 = Dijkstra's-SP(G3)
G[n, n] <- Graph
for i=1 to n
for j=1 to n
if D1[i][j]==1 or D2[i][j]==1 or D3[i][j]==1
G[i,j] = 1
else
G[i,j] = 0
return Dijkstra's-SP(G)
A5
MST3
int Average-MST(Graph* G1,Graph* G2,Graph* G3){
int min_g1=Algorithm_Prim_MST(G1);
int min_g2=Algorithm_Prim_MST(G2);
int min_g3=Algorithm_Prim_MST(G3);
return (min_g1+min_g2+min_g3)/3;
}
SP4
A5
MST3: AVG_MST(Graph G1, Graph G2, Graph G3):
MST1=Algorithm Prim's-MST(G1)
MST2=Algorithm Prim's-MST(G2)
MST3=Algorithm Prim's-MST(G3)
avgMST=ceil((MST1+MST2+MST3)/3)
return avgMST
MST for G1=12, G2=10, G3=10
AVG MST=(12+10+10)/3=10.66 or 11 weight
A5
SP4: Average-SSSP(Graph G1, Graph G2, Graph G3):
SP1[]=Algorithm Dijkstra's-SP(G1);
SP2[]=Algorithm Dijkstra's-SP(G2);
SP3[]=Algorithm Dijkstra's-SP(G3);
SP4[]=ceil((sum of element at index i in SP1[], SP2[], SP3[])/3) for i=1
to no. of vertices
return SP4[]
A5
MST3
Get MSTs of all the graphs. Combine their edges to make a new graph. Find the MST of this new graph.
Algorithm:
mst1 = PrimsMST(G1)
mst2 = PrimsMST(G2)
mst3 = PrimsMST(G3)
Graph G = new Graph(V: 6)
for all edges of mst1 do
insert edge in G
for all edges of mst2 do
insert edge in G
for all edges of mst2 do
insert edge in G
Graph avgMST = PrimsMST(G);
return avgMST
A5
SP4
Get the single source shortest path(SSSP) of all the graphs. After that, the
shortest path for each of the nodes can be taken as the minimum of the 3
SSSPs derived from the given graphs for the required vertex.
Algorithm:
for v of vertex 2 to 6 do
sssp1 = DijkstraSP(G1, 1, v)
sssp2 = DijkstraSP(G2, 1, v)
sssp3 = DijkstraSP(G3, 1, v)
avgSSSP[v] = min(sssp1, sssp2, sssp3)
end
A5
MST3. Make MST of the three graphs. Then we find the distance between two vertices on all those MST, take
there average and form a direct edge between those vertices with weight of that edge being the average
calculated earlier. We do this for every vertices pair. The resultant structure would be a completely connected
graph. We take the MST of this graph and that would be the result.
1 Average MST(G1,G2,G3):
2 GM1= Algorithm Prim's-MST(G1)
3 GM2= Algorithm Prim's-MST(G2)
4 GM3= Algorithm Prim's-MST(G3)
5 for all vertices(u, v) // u and v are vertices are one vertices pair
6 w=distance(u,v,GM1,GM2,GM3) // takes average of sum distance
7 Add(A, u, v, w) // Add edge of weight w between u and v in a graph A
8 return Algorithm Prim's-MST(A)
This would help us in order to understand what the average performance and space consumption by all three
methods. It would also tell us how every function is connected to one another and what should be the most
optimal way to define variables.
A5
SP4. The approach would be like that of Average-MST
We take Shortest Path between all vertices of the three graphs. Then we find the distance between
two vertices on all those graphs, take there average and form an edge between those vertices with
weight of that edge being the average calculated earlier. We do this for every vertices pair. The
resultant structure would be a completely connected graph. We take the shortest path of this graph
and that would be the result.
1 Average SSSP(G1,G2,G3):
2 GM1= Algorithm Dijkstra-SP(G1)
3 GM2= Algorithm Dijkstra-SP(G2)
4 GM3= Algorithm Dijkstra-SP(G3)
5 for all vertices(u,v) // u and v are vertices are one vertice pair
6 w=distance(u,v,GM1,GM2,GM3) // takes average of sum distance
7 Add(A,u,v,w) // Add edge of weight w between u and v in a graph A
8 return Algorithm Dijkstra-SP(A)
Q6
A6
• NP1) Calculate probability of each edge.
• NP2) Not reducible to TSP or any other NPC. Because the NP1 is a
simple problem that can be solved by calculating probability (for this
we need to traverse back to the same node, which is not allowed in
TSP), whereas NPCs are NP hard problems.
Q7
A7
AKS1
• The key idea of AKS primality test is to find the coefficient of xi in ((x+a)n - (xn + a)). If all
coefficients are multiple of n, then n is prime else composite number.
• To get internal elements, remove first and last elements of each row in a Pascal triangle. For a nth
row of a Pascal triangle, the internal element are the coefficients of above equation with a = -1,
then the equation ((x-1)n - (xn -1))
AKS2 For N=19
• ((x-1)19- (x19 -1)) = -19x18 + 171x17 - 969x16 + 3876x15 - 11628x14 + 27132x13 - 50388x12 + 75582x11 -
92378x10 + 92378x9 - 75582x8 + 50388x7 - 27132x6 + 11628x5 - 3876x4 + 969x3 - 171x2 + 19x.
• The coefficient of equation or the internal elements of Pascal triangle row: 1, 19, 171, 969, 3876,
11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1
• Here, each the coefficient or the internal element is the multiple of 19. Therefore, 19 is a prime
number as per AKS.
Q8 and A8
Q9 and A9
Q10 and A10
Q11 and A11
Thank You
Japanese
Hebrew
English
Merci
French
Russian
Danke
German
Grazie
Italian
Gracias
Spanish
Obrigado
Portuguese
Arabic
Simplified
Chinese
Traditional
Chinese
Tamil
Thai
Korean
https://sites.google.com/site/animeshchaturvedi07

Weitere ähnliche Inhalte

Was ist angesagt?

Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmAcad
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning treeSTEFFY D
 
Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sortMadhu Bala
 
Minimal spanning tree class 15
Minimal spanning tree class 15Minimal spanning tree class 15
Minimal spanning tree class 15Kumar
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning treeAlona Salva
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectStasik Nemirovsky
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquerKrish_ver2
 
Data Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge SortData Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge SortManishPrajapati78
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquerVikas Sharma
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03Krish_ver2
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysisOnkar Nath Sharma
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1Amrinder Arora
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsKrishnan MuthuManickam
 
Dynamic Programming - Part II
Dynamic Programming - Part IIDynamic Programming - Part II
Dynamic Programming - Part IIAmrinder Arora
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree methodRajendran
 

Was ist angesagt? (20)

Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sort
 
Minimal spanning tree class 15
Minimal spanning tree class 15Minimal spanning tree class 15
Minimal spanning tree class 15
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning tree
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final Project
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
Data Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge SortData Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge Sort
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of Algorithms
 
Dynamic Programming - Part II
Dynamic Programming - Part IIDynamic Programming - Part II
Dynamic Programming - Part II
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Time andspacecomplexity
Time andspacecomplexityTime andspacecomplexity
Time andspacecomplexity
 

Ähnlich wie Graph Analytics and Complexity Questions and answers

Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanationsGopi Saiteja
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationAlexander Litvinenko
 
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHMGRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHMhimanshumishra19dec
 
Comparative Report Ed098
Comparative Report Ed098Comparative Report Ed098
Comparative Report Ed098mikebrowl
 
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...Arthur Weglein
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...IJMIT JOURNAL
 
International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)IJMIT JOURNAL
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...IJMIT JOURNAL
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesMark Brandao
 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network PropertiesMarcus Märtens
 
Skiena algorithm 2007 lecture15 backtracing
Skiena algorithm 2007 lecture15 backtracingSkiena algorithm 2007 lecture15 backtracing
Skiena algorithm 2007 lecture15 backtracingzukun
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1luisescobedo38
 

Ähnlich wie Graph Analytics and Complexity Questions and answers (20)

E33018021
E33018021E33018021
E33018021
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanations
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
 
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHMGRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
 
lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
 
Optimisation random graph presentation
Optimisation random graph presentationOptimisation random graph presentation
Optimisation random graph presentation
 
Rsa documentation
Rsa documentationRsa documentation
Rsa documentation
 
Exhaustive Combinatorial Enumeration
Exhaustive Combinatorial EnumerationExhaustive Combinatorial Enumeration
Exhaustive Combinatorial Enumeration
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
Comparative Report Ed098
Comparative Report Ed098Comparative Report Ed098
Comparative Report Ed098
 
algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
Chang etal 2012a
Chang etal 2012aChang etal 2012a
Chang etal 2012a
 
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...
 
International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic Splines
 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network Properties
 
Skiena algorithm 2007 lecture15 backtracing
Skiena algorithm 2007 lecture15 backtracingSkiena algorithm 2007 lecture15 backtracing
Skiena algorithm 2007 lecture15 backtracing
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1
 

Mehr von Animesh Chaturvedi

Cloud platforms and frameworks
Cloud platforms and frameworksCloud platforms and frameworks
Cloud platforms and frameworksAnimesh Chaturvedi
 
Cloud service lifecycle management
Cloud service lifecycle managementCloud service lifecycle management
Cloud service lifecycle managementAnimesh Chaturvedi
 
Advance Systems Engineering Topics
Advance Systems Engineering TopicsAdvance Systems Engineering Topics
Advance Systems Engineering TopicsAnimesh Chaturvedi
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)Animesh Chaturvedi
 
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Animesh Chaturvedi
 
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Animesh Chaturvedi
 
C- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsC- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsAnimesh Chaturvedi
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solutionAnimesh Chaturvedi
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
System requirements engineering
System requirements engineeringSystem requirements engineering
System requirements engineeringAnimesh Chaturvedi
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems EngineeringAnimesh Chaturvedi
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingAnimesh Chaturvedi
 
Cloud Platforms and Frameworks
Cloud Platforms and FrameworksCloud Platforms and Frameworks
Cloud Platforms and FrameworksAnimesh Chaturvedi
 
Cloud Service Life-cycle Management
Cloud Service Life-cycle ManagementCloud Service Life-cycle Management
Cloud Service Life-cycle ManagementAnimesh Chaturvedi
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Animesh Chaturvedi
 

Mehr von Animesh Chaturvedi (20)

Cloud Platforms & Frameworks
Cloud Platforms & FrameworksCloud Platforms & Frameworks
Cloud Platforms & Frameworks
 
Cloud platforms and frameworks
Cloud platforms and frameworksCloud platforms and frameworks
Cloud platforms and frameworks
 
Cloud service lifecycle management
Cloud service lifecycle managementCloud service lifecycle management
Cloud service lifecycle management
 
Advance Systems Engineering Topics
Advance Systems Engineering TopicsAdvance Systems Engineering Topics
Advance Systems Engineering Topics
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
 
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
 
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
 
C- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutionsC- Programming Assignment practice set 2 solutions
C- Programming Assignment practice set 2 solutions
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solution
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
System requirements engineering
System requirements engineeringSystem requirements engineering
System requirements engineering
 
Informatics systems
Informatics systemsInformatics systems
Informatics systems
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computing
 
Cloud Platforms and Frameworks
Cloud Platforms and FrameworksCloud Platforms and Frameworks
Cloud Platforms and Frameworks
 
Cloud Service Life-cycle Management
Cloud Service Life-cycle ManagementCloud Service Life-cycle Management
Cloud Service Life-cycle Management
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)
 
Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?Pumping Lemma and Regular language or not?
Pumping Lemma and Regular language or not?
 

Kürzlich hochgeladen

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Kürzlich hochgeladen (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Graph Analytics and Complexity Questions and answers

  • 1. Graph Analytics and Complexity Questions and Answers by Dr.Animesh Chaturvedi Assistant Professor: LNMIIT Jaipur Post Doctorate: King’s College London &TheAlanTuring Institute PhD: IIT Indore
  • 2. Answers of Fill in the Blank
  • 3. Answers of Match The Column
  • 4. Answers of Match The Column
  • 5. Answers of Fill in the Blank
  • 6. Answers of Match The Column
  • 7. Q5
  • 8. Q5
  • 9. A5 There could be many ways to answer this question. For example • CG1: the number of incoming edges to that function, the priority of calling a procedures, number of variables function B inherits from function A, time required to call, cost of calling a procedure by a caller procedure, time or duration of call or request between two procedures, etc. • WN2: frequency of the word, memory required to store a word, cost we must spend in order to connect, number of conjunction between words.
  • 10. A5 MST3) Average-MST(G1, G2, G3) n = size of G1 M1 = Prim's-MST(G1) M2 = Prim's-MST(G2) M3 = Prim's-MST(G3) G[n, n] <- Graph for i=1 to n for j=1 to n if M1[i][j]==1 or M2[i][j]==1 or M3[i][j]==1 G[i,j] = 1 else G[i,j] = 0 return Prim's-MST(G)
  • 11. A5 SP4) Average-SSSP(G1, G2, G3) n = size of G1 D1 = Dijkstra's-SP(G1) D2 = Dijkstra's-SP(G2) D3 = Dijkstra's-SP(G3) G[n, n] <- Graph for i=1 to n for j=1 to n if D1[i][j]==1 or D2[i][j]==1 or D3[i][j]==1 G[i,j] = 1 else G[i,j] = 0 return Dijkstra's-SP(G)
  • 12. A5 MST3 int Average-MST(Graph* G1,Graph* G2,Graph* G3){ int min_g1=Algorithm_Prim_MST(G1); int min_g2=Algorithm_Prim_MST(G2); int min_g3=Algorithm_Prim_MST(G3); return (min_g1+min_g2+min_g3)/3; } SP4
  • 13. A5 MST3: AVG_MST(Graph G1, Graph G2, Graph G3): MST1=Algorithm Prim's-MST(G1) MST2=Algorithm Prim's-MST(G2) MST3=Algorithm Prim's-MST(G3) avgMST=ceil((MST1+MST2+MST3)/3) return avgMST MST for G1=12, G2=10, G3=10 AVG MST=(12+10+10)/3=10.66 or 11 weight
  • 14. A5 SP4: Average-SSSP(Graph G1, Graph G2, Graph G3): SP1[]=Algorithm Dijkstra's-SP(G1); SP2[]=Algorithm Dijkstra's-SP(G2); SP3[]=Algorithm Dijkstra's-SP(G3); SP4[]=ceil((sum of element at index i in SP1[], SP2[], SP3[])/3) for i=1 to no. of vertices return SP4[]
  • 15. A5 MST3 Get MSTs of all the graphs. Combine their edges to make a new graph. Find the MST of this new graph. Algorithm: mst1 = PrimsMST(G1) mst2 = PrimsMST(G2) mst3 = PrimsMST(G3) Graph G = new Graph(V: 6) for all edges of mst1 do insert edge in G for all edges of mst2 do insert edge in G for all edges of mst2 do insert edge in G Graph avgMST = PrimsMST(G); return avgMST
  • 16. A5 SP4 Get the single source shortest path(SSSP) of all the graphs. After that, the shortest path for each of the nodes can be taken as the minimum of the 3 SSSPs derived from the given graphs for the required vertex. Algorithm: for v of vertex 2 to 6 do sssp1 = DijkstraSP(G1, 1, v) sssp2 = DijkstraSP(G2, 1, v) sssp3 = DijkstraSP(G3, 1, v) avgSSSP[v] = min(sssp1, sssp2, sssp3) end
  • 17. A5 MST3. Make MST of the three graphs. Then we find the distance between two vertices on all those MST, take there average and form a direct edge between those vertices with weight of that edge being the average calculated earlier. We do this for every vertices pair. The resultant structure would be a completely connected graph. We take the MST of this graph and that would be the result. 1 Average MST(G1,G2,G3): 2 GM1= Algorithm Prim's-MST(G1) 3 GM2= Algorithm Prim's-MST(G2) 4 GM3= Algorithm Prim's-MST(G3) 5 for all vertices(u, v) // u and v are vertices are one vertices pair 6 w=distance(u,v,GM1,GM2,GM3) // takes average of sum distance 7 Add(A, u, v, w) // Add edge of weight w between u and v in a graph A 8 return Algorithm Prim's-MST(A) This would help us in order to understand what the average performance and space consumption by all three methods. It would also tell us how every function is connected to one another and what should be the most optimal way to define variables.
  • 18. A5 SP4. The approach would be like that of Average-MST We take Shortest Path between all vertices of the three graphs. Then we find the distance between two vertices on all those graphs, take there average and form an edge between those vertices with weight of that edge being the average calculated earlier. We do this for every vertices pair. The resultant structure would be a completely connected graph. We take the shortest path of this graph and that would be the result. 1 Average SSSP(G1,G2,G3): 2 GM1= Algorithm Dijkstra-SP(G1) 3 GM2= Algorithm Dijkstra-SP(G2) 4 GM3= Algorithm Dijkstra-SP(G3) 5 for all vertices(u,v) // u and v are vertices are one vertice pair 6 w=distance(u,v,GM1,GM2,GM3) // takes average of sum distance 7 Add(A,u,v,w) // Add edge of weight w between u and v in a graph A 8 return Algorithm Dijkstra-SP(A)
  • 19. Q6
  • 20. A6 • NP1) Calculate probability of each edge. • NP2) Not reducible to TSP or any other NPC. Because the NP1 is a simple problem that can be solved by calculating probability (for this we need to traverse back to the same node, which is not allowed in TSP), whereas NPCs are NP hard problems.
  • 21. Q7
  • 22. A7 AKS1 • The key idea of AKS primality test is to find the coefficient of xi in ((x+a)n - (xn + a)). If all coefficients are multiple of n, then n is prime else composite number. • To get internal elements, remove first and last elements of each row in a Pascal triangle. For a nth row of a Pascal triangle, the internal element are the coefficients of above equation with a = -1, then the equation ((x-1)n - (xn -1)) AKS2 For N=19 • ((x-1)19- (x19 -1)) = -19x18 + 171x17 - 969x16 + 3876x15 - 11628x14 + 27132x13 - 50388x12 + 75582x11 - 92378x10 + 92378x9 - 75582x8 + 50388x7 - 27132x6 + 11628x5 - 3876x4 + 969x3 - 171x2 + 19x. • The coefficient of equation or the internal elements of Pascal triangle row: 1, 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1 • Here, each the coefficient or the internal element is the multiple of 19. Therefore, 19 is a prime number as per AKS.