How can I initialise an igraph with weights?
This is what I have
cr = csv.reader(open("atlas.csv","rb"))
mapping = {}
for row in cr:
if int(row[2]) == 1:
continue
source = int(row[0])
target = int(row[1])
if source in mapping:
list = mapping[source]
list.append(target)
else:
mapping[source] = [target]
print mapping
G = Graph(edges = [(v, a) for v in mapping.keys() for a in mapping[v]])
print G
I tried adding weight using edges = (v, a, w)
but that doesn't work.