Find all chordless cycles in an undirected graph

前端 未结 5 1370
有刺的猬
有刺的猬 2020-12-04 15:47

How to find all chordless cycles in an undirected graph?

For example, given the graph

0 --- 1
|     | \\
|     |  \\
4 --- 3 - 2

th

5条回答
  •  一个人的身影
    2020-12-04 16:26

    Find all cycles.

    Definition of a chordless cycle is a set of points in which a subset cycle of those points don't exist. So, once you have all cycles problem is simply to eliminate cycles which do have a subset cycle.

    For efficiency, for each cycle you find, loop through all existing cycles and verify that it is not a subset of another cycle or vice versa, and if so, eliminate the larger cycle.

    Beyond that, only difficulty is figuring out how to write an algorithm that determines if a set is a subset of another.

提交回复
热议问题