Skip to Content
author's profile photo Former Member
Former Member

Diagram complexity metric? Mechanism to quantify crossing lines in a diagram?

I'm looking to see if I can generate a metric to cover how complex (and driving towards a (un)readability metric) a ERD diagram is. I was thinking using the number of entities, number of relationships, ideally the size of the canvas to provide a view on the compactness of the model. So I think this is largely doable - but if someone already has done this I'll happily reuse it.

However to make this even better I think having a count of crossing relationship lines would provide an interesting weighting for readability.

So two questions:

1) has anyone done this before, and can share?

2) Is it possible to work out the number of relationship lines crosses?

Many thanks,


Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Jun 17, 2016 at 07:50 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks - that is helpful. The number of times I've looked into the samples, and told others to do so - now its happened to me!

      However these stats don't immediately help on a per diagram basis, but definitely interesting none the less.

      Many thanks for pointing that one out,


  • Posted on Jun 16, 2016 at 12:02 PM

    Sounds interesting, Gareth.

    You could use diagram.GetPagesCount() to get an indication of the size of a diagram, after setting diagram.PageFormat and PageOrientation to a common value.

    I can't see an easy way of spotting lines that cross, you'd have to use the co-ordinates of each line segment, and use a vector graphics function to see if any of them cross over - I've a vague feeling I've seen somebody write about that somewhere.

    You'd also want to look out for overlapping entity symbols (if notation = Barker, some of them are obviously meant to overlap).

    Add comment
    10|10000 characters needed characters exceeded