Problem: Minimize the number of cameras police need to install, and still be as effective as possible with their monitoring at traffic intersections. Inter-Process Communication (IPC) which links output generated by C++ with optimizing graph problem executed in Python script, which further provided as an input to the C++ program to find shortest path between them.
Here I have introduced the vertex cover problem. In this problem The program in C++ that generates random input of vertices and edges that will be provided to Python script, which will further pass to C++ program to find a shortest path.
For the first file: "add" is used to add a street. "mod" is used to modify the specification of a street. "rm" is used to remove a street. "gg" is used to print the output of the corresponding graph. Example : add "Weber Street" (2,-1) (2,2) (5,5) (5,6) (3,8) add "King Street S" (4,2) (4,8) add "Davenport Road" (1,4) (5,8) gg
Output: V = 10 E = { <1,3>, <2,3>, <3,4>, <3,6>, <7,6>, <6,5>, <9,6>, <6,8>, <6,10> }
For the second file: Which takes an input as number of vertices and list of edges between them and the source and destination vertex. The resulted output will be the shortest path between the source and the destination vertex.
For the third file: It makes use of Inter-Process Communication between the above two files, the first will generate the graph according to the input and the second file will compute the shortest path between the source and destination node. I have used the rgen.cpp file which generates the graph randomly and the output is being provided to the first file, again the output of the python script is provided to the second file.