'How to add edges between any two nodes on a condition?
I have the following data set, variable "factor" denotes nodes, and variable "percent" is the attribute of the node. What I want to do is to create edges between all pairs of the nodes on the condition that the product of "percent" value of a pair is above a threshold.
For instance, suppose I set the threshold as 0.05, then the edges will only be created between A and B, B and C, and A and C. Thanks.
Factor: A, B, C, D, ... Percent: 0.4, 0.3, 0.2, 0.1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
