How many unique cycles of length 4 present in a complete Undirected graph of 6 vertices? My answer is 45 and i think its not correct because there are only 4 options 1)15 2)30 3)90 4)360 please share your view
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
How many unique cycles of length 4 present in a complete Undirected graph of 6 vertices? My answer is 45 and i think its not correct because there are only 4 options 1)15 2)30 3)90 4)360 please share your view
Name |
---|
What's source of the problem? It looks like test question.
the answer is 90, if we consider cycles 1 -> 2 -> 3 -> 1 and 1 -> 3 -> 2 -> 1 as different cycles (directed graph).
sorry i forgot to mention that graph is undirected.SO obviously 90 reduces to 45
It is not so obviously. Forget about directed graph or not, but we can go from x to y, and from y to x for any pair of vertices. The question is: consider we such cycles as one, or they are two different cycles? It is matter for you to go in order Paris, London, Moscow, Berlin, or Berlin, Moscow, London, Paris? Just example. John wants to bring souvenir from Paris to his grandmother in London. And Ivan want to go from Moscow to London. So, for John and Ivan order is matter. Especially if you need to bring a souvenir as soon as possible (perishable food e.g.)
If order and starting vertex don't matter, any set with 4 vertices will uniquely describe a cycle, won't it? The cycle certainly exists, since the graph is complete. So isn't the answer just (6 4) = 6!/(4!2!) = 15 ? [UPD: No, the answer is 90 because of permutations]
1 2 3 4, 1 3 4 2, 1 (any permutaion of 3 other vertices (2, 3, 4)). (6, 4) * 3! = 90
You're right, thanks. Another way of seeing the math is: Given a subset of 4 vertex, any permutation of its elements results in a different cycle (so the answer would be (6,4) * 4! = 360). However, "cyclic cycles" (like 1 2 3 4 and 2 3 4 1) are the same cycle, and are cleary counted exactly 4 times. So the answer is 360/4 = 90. Thank you very much!
you are considering directed graph ..I want solution for Undirected.with any 4 vertices there will be only 3 distinct cycles of length 4 .so answer comes out to be 45
It is not matter directed graph or not. Read carefully my comments above. Cycle is not set of edges. [Cycle](http://en.wikipedia.org/wiki/Cycle_(graph_theory)) is a closed path. [Path](http://en.wikipedia.org/wiki/Path_(graph_theory)) in a graph is a sequence of vertices such that from each of its vertices there is an edge to the next vertex in the sequence. If element of the sequence has next element in it, it means the order is matter. Path 1 -> 2-> 3 -> 4 and 4 -> 3 -> 2 -> 1 are two different pathes.