Reputation: 9
I am generating graphs with edges being assigned random weights. How can I guarantee that the weights of edges obey the triangle inequality? I saw a similar question that has been asked but couldn't really follow the answer
Upvotes: 0
Views: 450
Reputation: 859
In the supplementary material of The geometric nature of weights in real complex networks paper, you find a section called TEST OF THE TRIANGLE INEQUALITY in which they explain in detail how to perform the test. You can find the paper and the supplementary file from the author's website. I also agree with @David Conrad that this question belongs to the algorithm tag.
Upvotes: 0
Reputation: 46408
@Tau is right, there are a lot of ways to solve this problem.
I can come up with more strategies as well. But the real question is why you are doing this, and whether there are any hidden requirements that make one solution better than another.
Upvotes: 1