Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
1b185bcb
Commit
1b185bcb
authored
May 28, 2016
by
Tiago Peixoto
Browse files
collection.konect: Fix handling of bipartite graphs
parent
26e770f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/collection/konect.py
View file @
1b185bcb
...
@@ -62,6 +62,8 @@ def load_koblenz_dir(dirname):
...
@@ -62,6 +62,8 @@ def load_koblenz_dir(dirname):
if
"asym"
not
in
line
:
if
"asym"
not
in
line
:
g
.
set_directed
(
False
)
g
.
set_directed
(
False
)
edges
[:,:
2
]
-=
1
# we need zero-based indexing
edges
[:,:
2
]
-=
1
# we need zero-based indexing
if
"bip"
in
line
:
# bipartite graphs have non-unique indexing
edges
[:,
1
]
+=
edges
[:,
0
].
max
()
+
1
g
.
add_edge_list
(
edges
[:,:
2
])
g
.
add_edge_list
(
edges
[:,:
2
])
if
edges
.
shape
[
1
]
>
2
:
if
edges
.
shape
[
1
]
>
2
:
g
.
ep
.
weight
=
g
.
new_edge_property
(
"int"
)
g
.
ep
.
weight
=
g
.
new_edge_property
(
"int"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment