I don't get the role of the diagram here.
Do you want to limit your calculation to only elements shown on the diagram? Or even only the connectors shown on a diagram?
Why? What importance does the diagram have? I could understand doing a calculation like that for a package, or a whole model, but for a diagram?
Anyway, second thing to look for is how to determine is which type of connectors you are going to use. Only associations, or also dependencies, generalizations, messages,...
And what are you going to do with exotic things like n-ary associations and association classes?
Then one you have established that you will have to determine, for each type of connectors how to determine the "functional" client and the "functional" supplier.
For associations, to give you an example, the client/supplier fields are based on the direction the association is drawn, which doesn't really bear any meaning.
Then when you've defined all of that you might want to think further for other types of dependencies. Think type of attributes and parameters, reference in tagged values,...
So it looks you've still got some work to do

Geert