|
@@ -24,7 +24,7 @@ for elem in root:
|
|
|
if elem.tag == namespace + 'node':
|
|
if elem.tag == namespace + 'node':
|
|
|
# print (elem.attrib['id'], " weight: ")
|
|
# print (elem.attrib['id'], " weight: ")
|
|
|
node_map[elem.attrib['id']] = nodex_index
|
|
node_map[elem.attrib['id']] = nodex_index
|
|
|
- while len(adjacency_list) < nodex_index:
|
|
|
|
|
|
|
+ while len(adjacency_list) - 1 < nodex_index:
|
|
|
adjacency_list.append([])
|
|
adjacency_list.append([])
|
|
|
nodex_index += 1
|
|
nodex_index += 1
|
|
|
|
|
|
|
@@ -33,7 +33,7 @@ for elem in root:
|
|
|
# print (sub_elem.attrib['key'])
|
|
# print (sub_elem.attrib['key'])
|
|
|
if sub_elem.attrib['key'] == weight_id:
|
|
if sub_elem.attrib['key'] == weight_id:
|
|
|
# print (sub_elem.text)
|
|
# print (sub_elem.text)
|
|
|
- node_weight.append(int(sub_elem.text))
|
|
|
|
|
|
|
+ node_weight.append(int(float(sub_elem.text)))
|
|
|
# get edge
|
|
# get edge
|
|
|
elif elem.tag == namespace + 'edge':
|
|
elif elem.tag == namespace + 'edge':
|
|
|
source_index = node_map[elem.attrib['source']]
|
|
source_index = node_map[elem.attrib['source']]
|