SlideShare a Scribd company logo
1 of 27
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Similar to Graph Analytics Complexity Q&A Dr. Animesh Chaturvedi King's College London IIT Indore

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
 

Similar to Graph Analytics Complexity Q&A Dr. Animesh Chaturvedi King's College London IIT Indore (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
 

More from 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
 

More from 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?
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Graph Analytics Complexity Q&A Dr. Animesh Chaturvedi King's College London IIT Indore

  • 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.