Skip to content

Unpredictable results when allocating graphs with huge number of vertices #405

@clpippel

Description

@clpippel

Hello,
I carried out a number of tests. See below:

library(igraph)
nvert <- .Machine$integer.max - 1                  # number of vertices's
make_graph      (n=nvert, edges = c() )            # Error in  (out of memory)
make_tree       (n=nvert)                          # Error in  (out of memory)
make_ring       (n=nvert)                          # Error in  (out of memory)
make_star       (n=nvert)                          # crash     <<<<<<<<<<<<<<<
make_empty_graph(n=nvert)                          # Error in  (out of memory)
make_full_citation_graph(n=nvert)                  # crash     <<<<<<<<<<<<<<<

library(igraph)
nvert <- .Machine$integer.max                      # number of vertices's
make_graph      (n=nvert, edges = c() )            # crash
make_tree       (n=nvert)                          # crash
make_ring       (n=nvert)                          # Error in  (out of memory)
make_star       (n=nvert)                          # crash 
make_empty_graph(n=nvert)                          # crash
make_full_citation_graph(n=nvert)                  # crash     <<<<<<<<<<<<<<<

library(igraph)
nvert <- .Machine$double.xmax                       # number of vertices's
make_graph      (n=nvert, edges = c() )            # empty graph, no warning
make_tree       (n=nvert)                          # empty graph, no warning
make_ring       (n=nvert)                          # empty graph, no warning
make_star       (n=nvert)                          # empty graph, no warning
make_empty_graph(n=nvert)                          # empty graph with many vertices's, possible:
                                                   # Error: cannot allocate vector of size 2.1 Gb
make_full_citation_graph(n=nvert)                  # crash     <<<<<<<<<<<<<<<
make_full_citation_graph(n=NA)                     # crash     <<<<<<<<<<<<<<<         

The "out of memory"errors are OK. Crashes are obviously NOK. I am not sure creating empty graphs is OK, when the number of vertices (n) is not equal to zero.

Sysinfo in issue #404

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions