aicenter / ShoDi

0 stars 0 forks source link

Custom binary file formats should use larger datatypes for 'amount of edges' #7

Closed neumannjan closed 4 years ago

neumannjan commented 4 years ago

Custom binary file formats currently use unsigned int for amount of nodes and amount of edges. As described in issue #3, this may result in integer overflow if a graph is (or is close to being) a complete graph.

Therefore, this data should be stored as unsigned long or unsigned long long.

F-I-D-O commented 4 years ago

Ok, but we can change the format, right? :)

neumannjan commented 4 years ago

Currently the issue is resolved simply using boost::numeric_cast<unsigned int>(...). That way we get an error instead of overflow if our graph has more nodes/edges than UINT_MAX. The same solution is now in many places within the code.

Do we still want to modify the file output?

F-I-D-O commented 4 years ago

Ok, we can leave it as it is for now.