The is_weighted()
method simply checks whether your graph has an edge attribute named weight
. In your case, you don't because the values from the GML file are stored in the value
edge attribute, not in weight
. The solution is either to replace every occurrence of value
with weight
in your input file, or to rename the attribute in igraph after you have loaded the file as follows:
g.es["weight"] = g.es["value"]
del g.es["value"]