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