graph_tool.edge_endpoint_property#

graph_tool.edge_endpoint_property(g, prop, endpoint, eprop=None)[source]#

Return an edge property map corresponding to the vertex property prop of either the target and source of the edge, according to endpoint.

Parameters:
propVertexPropertyMap

Vertex property map to be used to propagated to the edge.

endpoint“source” or “target”

Edge endpoint considered. If the graph is undirected, the source is always the vertex with the lowest index.

epropEdgePropertyMap (optional, default: None)

If provided, the resulting edge properties will be stored here.

Returns:
epropEdgePropertyMap

Propagated edge property.

Examples

>>> gt.seed_rng(42)
>>> g = gt.random_graph(100, lambda: (3, 3))
>>> esource = gt.edge_endpoint_property(g, g.vertex_index, "source")
>>> print(esource.a)
[51 19 33 37 36 95 63 60 88 14  5  8 91 81 79 85 22 93 98 30 78 56  5  2
 57 65 52 64 15 62  3 83 22 83 58 43 20 33 96 48 94 49 71 84 91 64 41 92
 43 57 13 24 63 19 79 38 32 37 98 45 62 55 11 45 59 71 76 82 28 94 21 75
 92 52  6  7 46 97 10 70 66  2 19 84 21 76 60 74 85 95 24 65 16 90 38 69
 52 80 67 80 49  1 32 51 40 56 87 13 40  5 81 79 74 30 41 92 41 23 24 22
 61 14 85 63 25 80  4 56 36 44 28 86 55 20 67 53 53 97  1 55  6 82 35  8
 17 34 82 77 47 25 73 50 97 98 17  1 27 93 18 54 95 23 47 48  3 26 66 31
 35 50 90 99 99 89 65 57 11 73  0  0 47 12 21 39 31 18 10 13 64 29 14 17
 69 58 86 99 34 38 50  9 40 54 16 68 70 23  6 29 37 74 59 10 88  7 33 87
 73 58 89 45 18 60 34 61 61 68 70 28 15  9 12 90 66 59 46  7 54 84 75 29
 88 87 15 93 35 51 67 71 96 86 94 48 26 72 72  4  3 43 77 91 31 12 96 76
 49 27 42 26 62  2 81 42 11 20 83 44 16 78 27 75 44 39 36  0 53 68 78 39
 89 77  4 46 25  8 30 72 32 69  9 42]