by Dinesh Thakur Category: Software Engineering

For a programmer, to understand a given program, he typically draws arrows from the point of control transfer to its destination, helping him to create a mental picture of the program and the control transfer in it.


According to this metric the more interwined these arrows become the more complex the program. This notion is captured in the concept of a "Knot".

A knot is essentially the intersection of two such control transfer arrows. If each statement in the program is written one as separate line, this notion can be formalized as follows. A jump from line a to line b is represented by the pair (a, b).


Two jumps  (a,b) and (p,q) give rise to a knot if either min (a,b) <min (p,q)<max(a,b) and max (p,q) > max (a,b) ;or min (a,b)< max (p, qa)< max(a,b) and min (p, q)< min (a,b).

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Search Content