View source: R/10-grafos-TSP.R
next_index | R Documentation |
Next position to i in a cycle.
next_index(i, n)
i |
Position in cycle |
n |
Lenght of cycle |
In a cycle, the next slot to the i-th position is i+1 unless i=n. In this case, the next is 1.
The next position in cycle
Cesar Asensio
next_index(5, 7) # 6
next_index(7, 7) # 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.