frag.cycles {archeofrag} | R Documentation |

## Count the k-cycles in a graph, for cycles =< k

### Description

Count the k-cycles in a graph, for cycles =< k

### Usage

```
frag.cycles(graph, kmax, max.cycles.only=FALSE)
```

### Arguments

`graph` |
An |

`kmax` |
Maximal length of the cycles to detect. |

`max.cycles.only` |
Logical. If TRUE, the fragments are only reported as parts of their longer cycle. |

### Details

A cycle can be part of larger cycle: if `max.cycles.only`

all the cycles are reported but, if this parameter is True only the larger cycles are reported.
A warning recalls that for cycles k > 4 the fragments of a cycle are not necessarily all connected to each other (a fragment, due to its location in the original object, can only be connected to a limited number of adjacent fragments).

### Value

A data frame with the number of k-cycles for each k values in [3;k].

### Author(s)

Sebastien Plutniak <sebastien.plutniak at posteo.net>

### See Also

### Examples

```
g <- frag.simul.process(n.components=20, vertices=50, disturbance=.15)
frag.cycles(g, kmax=4, max.cycles.only=FALSE)
frag.cycles(g, kmax=4, max.cycles.only=TRUE)
```

[Package

*archeofrag*version 0.8.2 Index]