SlideShare a Scribd company logo
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 algorithm
Acad
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
STEFFY D
 
Divide and conquer - Quick sort
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sort
Madhu Bala
 
Minimal spanning tree class 15
Minimal spanning tree class 15Minimal spanning tree class 15
Minimal spanning tree class 15Kumar
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
Dr Shashikant Athawale
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning tree
Alona Salva
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Muhammad Sarfraz
 
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
Stasik Nemirovsky
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
Krish_ver2
 
Data Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge SortData Structure and Algorithms Merge Sort
Data Structure and Algorithms Merge Sort
ManishPrajapati78
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Vikas Sharma
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03
Krish_ver2
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Hinal Lunagariya
 
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
Onkar Nath Sharma
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
Amrinder Arora
 
CS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of AlgorithmsCS8451 - Design and Analysis of Algorithms
CS8451 - Design and Analysis of Algorithms
Krishnan MuthuManickam
 
Dynamic Programming - Part II
Dynamic Programming - Part IIDynamic Programming - Part II
Dynamic Programming - Part II
Amrinder Arora
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Time andspacecomplexity
Time andspacecomplexityTime andspacecomplexity
Time andspacecomplexity
LAKSHMITHARUN PONNAM
 

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 and Complexity Questions and answers

E33018021
E33018021E33018021
E33018021
IJERA Editor
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanations
Gopi 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 Quantification
Alexander Litvinenko
 
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHMGRAPH - DISCRETE STRUCTURE AND ALGORITHM
GRAPH - DISCRETE STRUCTURE AND ALGORITHM
himanshumishra19dec
 
lecture6.ppt
lecture6.pptlecture6.ppt
lecture6.ppt
AbhiYadav655132
 
Optimisation random graph presentation
Optimisation random graph presentationOptimisation random graph presentation
Optimisation random graph presentation
Venkat Sai Sharath Mudhigonda
 
Rsa documentation
Rsa documentationRsa documentation
Rsa documentation
Farag Zakaria
 
Exhaustive Combinatorial Enumeration
Exhaustive Combinatorial EnumerationExhaustive Combinatorial Enumeration
Exhaustive Combinatorial Enumeration
Mathieu Dutour Sikiric
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
Nv Thejaswini
 
Comparative Report Ed098
Comparative Report Ed098Comparative Report Ed098
Comparative Report Ed098mikebrowl
 
Chang etal 2012a
Chang etal 2012aChang etal 2012a
Chang etal 2012a
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...
Finite-difference modeling, accuracy, and boundary conditions- Arthur Weglein...
Arthur Weglein
 
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
 
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 Properties
Marcus 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°1
luisescobedo38
 

Similar to 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...
 
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...
 
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 & Frameworks
Cloud Platforms & FrameworksCloud Platforms & Frameworks
Cloud Platforms & Frameworks
Animesh Chaturvedi
 
Cloud platforms and frameworks
Cloud platforms and frameworksCloud platforms and frameworks
Cloud platforms and frameworks
Animesh Chaturvedi
 
Cloud service lifecycle management
Cloud service lifecycle managementCloud service lifecycle management
Cloud service lifecycle management
Animesh Chaturvedi
 
Advance Systems Engineering Topics
Advance Systems Engineering TopicsAdvance Systems Engineering Topics
Advance Systems Engineering Topics
Animesh 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-Hard
Animesh 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 solutions
Animesh Chaturvedi
 
C- Programming Assignment 4 solution
C- Programming Assignment 4 solutionC- Programming Assignment 4 solution
C- Programming Assignment 4 solution
Animesh Chaturvedi
 
C- Programming Assignment 3
C- Programming Assignment 3C- Programming Assignment 3
C- Programming Assignment 3
Animesh Chaturvedi
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
Animesh Chaturvedi
 
System requirements engineering
System requirements engineeringSystem requirements engineering
System requirements engineering
Animesh Chaturvedi
 
Informatics systems
Informatics systemsInformatics systems
Informatics systems
Animesh Chaturvedi
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
Animesh Chaturvedi
 
Big Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computingBig Data Analytics and Ubiquitous computing
Big Data Analytics and Ubiquitous computing
Animesh Chaturvedi
 
Cloud Platforms and Frameworks
Cloud Platforms and FrameworksCloud Platforms and Frameworks
Cloud Platforms and Frameworks
Animesh Chaturvedi
 
Cloud Service Life-cycle Management
Cloud Service Life-cycle ManagementCloud Service Life-cycle Management
Cloud Service Life-cycle Management
Animesh Chaturvedi
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)
Animesh 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

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

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.