Question
MPI Program You are supposed to use the given template for implementing each of the problems. Additionally, your program will be given two arguments, path
MPI Program
You are supposed to use the given template for implementing each of the problems. Additionally, your program will be given two arguments, path to an input file and an output file from which your program will obtain the input and output the result into respectively, like the following (for C++): mpirun -np 11 ./a.out
Given an undirected binary weighted graph G, find the number of cliques (of all possible weights) in the graph with sizes 3 and 4 (Refer to the sample input and output for clear understanding). Input: The first line contains two integers N and E, representing the number of vertices and the number of edges in the graph, respectively. Following E lines contain 3 integers (2 vertices and a weight) each, representing an edge between these two vertices with a binary weight (0 or 1). Note : 2 cliques are different if they have at least 1 vertex which is not common. There will be only 1 edge between any 2 vertices.
Output: Print a total of 11 lines. Each line should contain 3 space separated integers - size of clique weight of clique number of such cliques Constraints: 2 <= N <= 102, 1 <= E <= 103
Example: Sample Input: 7 11 1 2 0 2 3 0 2 4 1 3 4 0 3 5 1 1 5 1 1 6 0 6 7 1 7 5 1 7 1 0 6 5 1 1 3 0 2 5 1 2 Sample Output: 3 0 1 3 1 2 3 2 5 3 3 1 4 0 0 4 1 0 4 2 0 4 3 1 4 4 1 4 5 0 4 6 0
Code should be written in the middle of the template given below, where it is written as "Enter your code here"
# include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started