I have a network where each of my edges is labelled with a date. I want to now also label my vertices so that each vertex has a date assigned to it corresponding to the minimum date of all edges incident and emanating from it. Is there an inbuilt function to find this which would be faster than me looping over all vertices and then all edges for each vertex manually? In other words: I am after a function to find the minimum value of a given edge property for a given subset of edges.
My current code idea is:
lowest_year = 2016
for v in g.vertices():
for e in v.in_edges():
year = g.ep.year[e]
lowest_year = min(year,lowest_year)
for e in v.out_edges():
year = g.ep.year[e]
lowest_year = min(year,lowest_year)
g.vp.year[v]=lowest_year
lowest_year = 2016