Hacker News new | ask | show | jobs
by chrispeel 867 days ago
Kolmogorov complexity [1] is a measure of the complexity of an object (say a text), while Cyclomatic complexity is a measure of the complexity of a program. Can we make any statements about the relationship between them?

Let's say we have a text A, and we find a program P which is of length L and which the Kolmogorov complexity K(A); i.e. L=K(A). Does it make sense to compare the cyclomatic complexity C(P) with K(A)? Or can we write some equation or inequality the compares C(P) with K(A)?

I guess a first task would be to normalize one or the other so as to get the same units...

[1] https://en.wikipedia.org/wiki/Kolmogorov_complexity

1 comments

They're not meaningfully related. You can say certain things about them though, for example kolmogorov optimal programs will generally have higher cyclomatic complexity because they don't follow any fixed set of rules. Put another way, they lack the "simple" underlying structure that would be required.