MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / Transition

Function Transition

easygraph/functions/graph_embedding/NOBE.py:126–153  ·  view source on GitHub ↗
(LG)

Source from the content-addressed store, hash-verified

124
125
126def Transition(LG):
127 N = len(LG)
128 M = LG.size()
129 LLG = eg.DiGraph()
130 for i in LG.edges:
131 (u, v, t) = i
132 LLG.add_edge(u, v)
133 LLG.add_edge(v, u)
134 degree = LLG.degree()
135 P = np.zeros([2 * M, 2 * M])
136 pair = []
137 k = 0
138 l = 0
139 for i in LLG.edges:
140 l = 0
141 for j in LLG.edges:
142 (u, v, t) = i
143 (x, y, z) = j
144 if v == x and u != y:
145 P[k][l] = 1 / (degree[v] - 1)
146 l += 1
147 k += 1
148 a = 0
149 for i in LLG.edges:
150 (u, v, t) = i
151 pair.append([u, v])
152 a += 1
153 return P, pair
154
155
156def eigs_nodes(P, K):

Callers 1

NOBEFunction · 0.85

Calls 5

add_edgeMethod · 0.95
degreeMethod · 0.95
DiGraphMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected