Should I learn some graph theory in order to better understand commutative diagrams (and possibly category theory)? I was reading Lang's Algebra, and on page 17 he displays the following diagram:

.

I verified that the two square commute, but then I asked myself, is that really enough to prove that the entire diagram commutes? In other words, does commutativity of the squares imply the equivalence of any two paths from A to B (metaphorically)? I read this question and found Rob Arthan's final comment interesting, because in my case it seemed to show that, for example, $H \to G \to G/H \to G/H = H \to H/K \to G/K \to G/H$.
As I thought about this, graph theory came to mind. I know almost nothing about graph theory, but I'm wondering, would some knowledge of graph theory be worthwhile to help me better understand commutative diagrams (and possibly category theory)? Would learning some graph theory help me avoid wasting time doing redundant checks of diagrams?
I should add that on page x, Lang says "Most of our diagrams are
composed of triangles or squares as above, and to verify that a diagram consisting of triangles or squares is commutative, it suffices to verify that each triangle and square in it is commutative." Wikipedia says something similar here. However, in his Companion to Lang's Algebra, George Bergman says that's not necessarily true.
Thanks.
Edit:
Randall wants to see the counterexample I mentioned in the comments below this post, so I will post screenshots of the excerpt from Lang and then from Bergman.
Lang:




Bergman:




 A: As the only thing you're doing when checking commutativity is tracing paths, familiarity with graph theory will not be much use here, unless you just wanted to practise intuiting about tracing paths out.
Ultimately, when in doubt, it doesn't hurt to double-check that the pieces you've shown to be commutative do indeed imply commutativity of the entire diagram.
If you're still in doubt, you can always write these all down as equations (since commutative diagrams are ultimately just a visual presentation of a system of equalities of morphisms).
For example, in the commutative diagram
$\require{AMScd}$
\begin{CD}
A @>a>> B @>b>> C \\
@VuVV @VvVV @VVwV \\
X @>>p> Y @>>q> Z
\end{CD}
showing that the two squares commute amounts to showing that (1) $va=pu$ and (2) $wb=qv$.
From this, you can deduce commutativity of the perimeter just by equations:
\begin{align*}
wba \stackrel{(2)}= qva \stackrel{(1)}= qpu
\end{align*}
You can then trace these intermediates to see what they mean in the original commutative diagram, to also see how commutativity of the squares play a role.
In general, we're not usually concerned with commutativity of everything in sight but rather commutativity in the sense that the diagram has an "obvious" source and an "obvious" target, and we want all possible paths from the source to the target to commute.
For example, consider the pullback square

This sort of thing is also why commutativity is usually checked by showing all polygonal pieces commute: all of the polygonal pieces, and the entire diagram, have some consistent "direction" to them. In my original example, this direction is "from $A$ to $Z$", and in the squares, the sub-directions ("$A$ to $Y$" and "$B$ to $Z$" respectively) are consistent with this.
In general, if you have a (planar) commutative diagram where all the sub-polygons have an obvious direction that is consistent with the direction of the overall diagram, then commutativity of the overall diagram will follow from commutativity of the individual pieces (this is also true for the pullback diagram shape I provided: if the triangles and the square commute, then definitely the entire diagram will commute).
As for the counterexample you mentioned in the comments (create a square and add a point in the middle), the reason for the failure is that if all the arrows to the new object point inwards, then there's no "consistent direction" among the triangles, so commutativity of the four triangles may not imply commutativity of the perimeter of the square.
Just for the record, an explicit counterexample to this is the following: take a non-commutative square of sets
\begin{CD}
A @>>> B \\
@VVV @VVV \\
C @>>> D
\end{CD}
and then make the fifth middle object be the one-element set. Connect every set to this with the unique map into the one-element set, then the triangles will automatically all commute, but the perimeter will fail to.
Edit: since this is mentioned in your edit, you could also replace the one-element set with the empty set and reverse the direction of all four arrows, then again the triangles will all commute.
