edge_endpoint_property

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