MCPcopy Create free account
hub / github.com/alibaba/GraphScope / Compute

Method Compute

python/graphscope/tests/unittest/test_udf_app.py:110–124  ·  view source on GitHub ↗
(messages, v, context)

Source from the content-addressed store, hash-verified

108
109 @staticmethod
110 def Compute(messages, v, context):
111 src_id = context.get_config(b"src")
112 cur_dist = v.value()
113 new_dist = 1000000000.0
114 if v.id() == src_id:
115 new_dist = 0
116 for message in messages:
117 new_dist = min(message, new_dist)
118 if new_dist < cur_dist:
119 v.set_value(new_dist)
120 for e_label_id in range(context.edge_label_num()):
121 edges = v.outgoing_edges(e_label_id)
122 for e in edges:
123 v.send(e.vertex(), new_dist + e.get_int(2))
124 v.vote_to_halt()
125
126
127# Example of pie sssp

Callers

nothing calls this directly

Calls 10

valueMethod · 0.65
idMethod · 0.65
get_configMethod · 0.45
set_valueMethod · 0.45
edge_label_numMethod · 0.45
outgoing_edgesMethod · 0.45
sendMethod · 0.45
vertexMethod · 0.45
get_intMethod · 0.45
vote_to_haltMethod · 0.45

Tested by

no test coverage detected