Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkitBinaryReader tries to read edges multiple times #1192

Open
fabratu opened this issue Mar 1, 2024 · 0 comments
Open

NetworkitBinaryReader tries to read edges multiple times #1192

fabratu opened this issue Mar 1, 2024 · 0 comments

Comments

@fabratu
Copy link
Member

fabratu commented Mar 1, 2024

The NetworkitBinaryReader tries to read edges multiple times for undirected graphs. The resulting graph is correct, since the multi-edge is suppressed. Happens both for C++ and Python.

Example (in Python):

import networkit as nk
G = nk.generators.ErdosRenyiGenerator(100, 0.5, False, False).generate();
nk.overview(G)

nk.setLogLevel("DEBUG")

nkWriter = nk.graphio.NetworkitBinaryWriter()
nkWriter.write(G, "./G_gen.nkbg")
nkReader = nk.graphio.NetworkitBinaryReader()
G = nkReader.read("./G_gen.nkbg")
nk.overview(G)

Output of nk.overview:

Network Properties:
nodes, edges			100, 2477
directed?			False
weighted?			False
isolated nodes			0
self-loops			0
density				0.500404
clustering coefficient		0.501031
min/max/avg degree		38, 67, 49.540000
degree assortativity		-0.029328
number of connected components	1
size of largest component	100 (100.00 %)

Network Properties:
nodes, edges			100, 2477
directed?			False
weighted?			False
isolated nodes			0
self-loops			0
density				0.500404
clustering coefficient		0.501031
min/max/avg degree		38, 67, 49.540000
degree assortativity		-0.029328
number of connected components	1
size of largest component	100 (100.00 %)

Warnings:

[INFO ][/project/networkit/cpp/io/NetworkitBinaryWriter.cpp, 29: virtual void NetworKit::NetworkitBinaryWriter::write(const NetworKit::Graph&, const string&)]: Written graph to ./G_gen.nkbg
[WARN ][/project/networkit/cpp/io/NetworkitBinaryReader.cpp, 274: NetworKit::NetworkitBinaryReader::readData<NetworKit::MemoryMappedFile>::<lambda(uint64_t)>]: Not adding edge 0-1 since it is already present.
[WARN ][/project/networkit/cpp/io/NetworkitBinaryReader.cpp, 274: NetworKit::NetworkitBinaryReader::readData<NetworKit::MemoryMappedFile>::<lambda(uint64_t)>]: Not adding edge 0-4 since it is already present.
[WARN ][/project/networkit/cpp/io/NetworkitBinaryReader.cpp, 274: NetworKit::NetworkitBinaryReader::readData<NetworKit::MemoryMappedFile>::<lambda(uint64_t)>]: Not adding edge 0-5 since it is already present.
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant