Open yfyang86 opened 5 years ago
This only applies when G is an undirected graph (nx.Graph
rather than nx.DiGraph
). This "switch node strategy" is equal to dividing an undirected edge to two directed edges with opposite directions and equal weights.
I also can't understand this operation, no matter switching the head and tail nodes or not, you only input the edge in one direction. But in the original paper, it said if the graph is undirected, you are supposed to input an edge in two directions.
When we handle the second order similarity, why we need a random switch node strategy (i.e. beginning/ending nodes)?
https://github.com/snowkylin/line/blob/4cdfa7ada95858e8c3c1d78af5cdd1713357cd64/utils.py#L41
In the original paper, it enables developers to utilize the homogenous graph ("an undirected edge can be considered as two directed edges with opposite directions and equal weights").