Given an N-sided regular polygon, we have connected all the vertices at the center of the polygon, thus dividing the polygon into N equal parts. Our task is to the Count of the total number of cycles in the polygon.
Note: A Cycle is a closed-loop starting and ending on same point.
Approach: To the problem mentioned above we are supposed to count the total number of closed loops possible in the given polygon after division. The approach is based upon Mathematical Pattern. There will be N cycles already created due to the division of polygon. One out of N blocks will form a cycle with rest (N – 1) blocks. The remaining (N – 1) blocks will form cycle with other (N – 2) blocks. So the total cycles we have can be found out using the formula given below:
Total Cycles = N + 1 * (N – 1) + (N – 1) * (N – 2)
Total Cycles = 2 * N – 1) + (N – 1) * (N – 2)
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Number of triangles formed by joining vertices of n-sided polygon with one side common
- Number of triangles formed by joining vertices of n-sided polygon with two common sides and no common sides
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- Number of cycles in a Polygon with lines from Centroid to Vertices
- Angle between 3 given vertices in a n-sided regular polygon
- Find number of diagonals in n sided convex polygon
- Check if number formed by joining two Numbers is Perfect Cube
- Number of ways a convex polygon of n+2 sides can split into triangles by connecting vertices
- Apothem of a n-sided regular polygon
- Check if an N-sided Polygon is possible from N given angles
- Length of Diagonal of a n-sided regular polygon
- Area of a n-sided regular polygon with given Radius
- Central angle of a N sided Regular Polygon
- Determine the position of the third person on regular N sided polygon
- Side of a regular n-sided polygon circumscribed in a circle
- Area of a n-sided regular polygon with given side length
- Find the angle of Rotational Symmetry of an N-sided regular polygon
- Probability that the pieces of a broken stick form a n sided polygon
- Area of largest Circle inscribe in N-sided Regular polygon
- Check whether two convex regular polygon have same center or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.