Clustering number on ring lattice I have seen in several places a useful formula that lets us calculate the clustering number of regular ring lattice graphs with even degree, but I have not found a convincing proof of it. Concretely, the formula is $C=\dfrac{3(d-2)}{4(d-1)}$, where  $d$ is the degree of the graph and it is an even number.
The best proof of this fact which I have found it is the following one (extracted from http://www.hcs.harvard.edu/~cs134-spring2017/wp-content/uploads/2017/01/section2.pdf). 
However,  I have several questions about it:

*

*I am not be able to understand why the numerator represents the number of neighbors of $v$ which are connected by an edge.

*Although the formula works in most cases, there exist regular ring lattice graphs where the number given by the formula doesn't coincide with the real clustering number: for example in a triangle or in a hexagon whose vertices have degree $4$. Why doesn't the proof discard these cases? What is the extra condition that we need impose on the graph so this formula works?

Any help will be welcome.
 A: *

*We're trying to count the number of edges which lie entirely within $S$. We can do this using the handshaking lemma: for each vertex in $S$, count how many edges meeting that vertex have their other end in $S$, and divide by $2$. (Work on the induced subgraph with vertex set $S$: the number of edges in this graph is half the sum of degrees.)
Now $v$ has $d$ neighbours in $S$ - all of its neighbours are in $S$ by definition. Next, look at the vertex immediately to the left of $v$. All its neighbours to the right are still in $S$, but its leftmost neighbour will be $1+d/2$ steps to the left of $v$, so not in $S$. This means it has $d-1$ neighbours in $S$, and similarly for the vertex to the right of $v$. For the vertex two steps left of $v$, its two leftmost neighbours are too far away from $v$ to be in $S$, so it has $d-2$ neighbours in $S$, as does the vertex two right of $v$. Continuing in this way, the sum of degrees is $d+2(d-1)+2(d-2)+\cdots$. The sum stops when we get to the vertices as far as possible away from $v$. These are $d/2$ steps away, and only $d/2$ of their neighbours are in $S$. So the degree sum is $d+2(d-1)+\cdots+2(d-d/2)$, and you halve this to get the number of edges within $S$. (The final $-d$ in the numerator is because we don't want to include the edges meeting $v$, even though these are within $S$.)


*We have made an assumption in the proof above - if you look at a vertex in the left side of $S$, and go to a neighbour of that vertex which is further left, you can't get all the way around to the right side of $S$. This means the formula only works when this assumption is valid, i.e. $3d/2<n$, where $n$ is the total number of vertices. (So $n=6$ and $d=4$ just fails this test.)
