label_self_loops

label_self_loops#

graph_tool.generation.label_self_loops(g, mark_only=False, eprop=None)[source]#

Label edges which are self-loops, i.e, the source and target vertices are the same. For each self-loop edge set \(SL\), the labelling starts from 0 to \(|SL|-1\). If mark_only == True, self-loops are labeled with 1 and others with 0. If the eprop parameter is given (a EdgePropertyMap), the labelling is stored there.