In a graph, a vertex is called an articulation point if removing it and all the edges associated with it results in the increase of the number of connected components in the graph. For example consider the graph given in following figure.
If in the above graph, vertex 1 and all the edges associated with it, i.e. the edges 1-0, 1-2 and 1-3 are removed, there will be no path to reach any of the vertices 2, 3 or 4 from the vertices 0 and 5, that means the graph will split into two separate components. One consisting of the vertices 0 and 5 and another one consisting of the vertices 2, 3 and 4 as shown in the following figure.
Likewise removing the vertex 0 will disconnect the vertex 5 from all other vertices. Hence the given graph has two articulation points: 0 and 1.
Articulation Points represents vulnerabilities in a network.
Program in C :
Output:
Please comment below in case of any problem found during running the code or any other doubts.
Travelling Salesman Problem is defined as “Given a list of cities and the distances between each pair of cities, what is the
shortest possible route that visits each city exactly once and returns to the origin city?” It is an NP-hard problem.
Bellman–Held–Karp algorithm:
Compute the solutions of all subproblems starting with the smallest. Whenever computing a solution requires solutions for
smaller problems using the above recursive equations, look up these solutions which are already computed. To compute a minimum
distance tour, use the final equation to generate the 1st node, and repeat for the other nodes. For this problem, we cannot
know which subproblems we need to solve, so we solve them all.
Program in C :
Output:
Please comment below in case of any problem found during running the code or any other doubts.