# Number of independent KVL equations in a circuit?

Why, for a circuit with B branches and N nodes, the number of the linearly independent KVL equations for a network is: B-N+1 ?

If you just think of the branches alone, which connect two nodes, then there are a maximum of $2\cdot B$ unique nodes. Of course, none of them are connected to each other in this case. But since it is required that every node in a circuit be shared by at least two branches, there must be no more than half that, or $N\le \left(\frac{2\cdot B}{2}=B\right)$ nodes. So $N \le B$. If N is exactly equal to B, then each node connects exactly two branches and there is only one loop.
If $N= B$, the number of loops is $B-N+1=1$. But if you now remove one branch and re-add it elsewhere as mentioned above, you haven't changed $B$ but you did reduce the node count $N$ by 1 (the tail node of that tail end branch was uniquely numbered before, but will now be attached to a previously numbered node, reducing the count of nodes by 1.) So now you have 2 unique loops and again this is $B-N+1$, or now 2. And so on.