Given two integers V and E which represent the number of Vertices and Edges of a Planar Graph. The Task is to find the number of regions of that planar graph.
Planar Graph: A planar graph is one in which no edges cross each other or a graph that can be drawn on a plane without edges crossing is called planar graph.
Region: When a planar graph is drawn without edges crossing, the edges and vertices of the graph divide the plane into regions..
Input: V = 4, E = 5
Output: R = 3
Input: V = 3, E = 3
Output: R = 2
Approach: Euler found out the number of regions in a planar graph as a function of the number of vertices and number of edges in the graph i.e.
Below is the implementation of the above approach:
- Program to find total number of edges in a Complete Graph
- Find length of the largest region in Boolean Matrix
- Find the area of the shaded region formed by the intersection of four semicircles in a square
- Maximum number of region in which N non-parallel lines can divide a plane
- Program to find Circuit Rank of an Undirected Graph
- Program to find the diameter, cycles and edges of a Wheel Graph
- Program to count Number of connected components in an undirected graph
- Find the number of paths of length K in a directed graph
- Program to find the Nth Prime Number
- Program to find the nth Kynea number
- Program to find the Hidden Number
- Program to find the Nth Harmonic Number
- Program to find the number from given holes
- Program to find the next prime number
- Program to find the number of men initially
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.