# Erratic behaviour of make\_empty\_graph(NULL)

**URL:** <https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388>\
**Category:** Usage\
**Tags:** C, R\
**Created:** [29 July 2020 14:35 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388 "2020-07-29T14:35:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![clpippel](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@clpippel](https://igraph.discourse.group/u/clpippel)\
**Post date:** [29 July 2020 14:35 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/1 "2020-07-29T14:35:53Z")

</div>

make\_empty\_graph(NULL) gives sometimes

```auto
IGRAPH d2cceb6 D--- 301407984 0 -- 
+ edges from d2cceb6:

```

or

`Error: cannot allocate vector of size 2.2 Gb`

Is this a C library issue and what is the appropriate place to address this issue.

I am aware NULL != 0, but the function should either give an error or behave as if no parameters.

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [29 July 2020 15:00 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/2 "2020-07-29T15:00:11Z")

</div>

It is not a C library issue.

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [29 July 2020 15:15 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/3 "2020-07-29T15:15:37Z")

</div>

I guess the glue code between R and C ought to check that integers have at least size 1 (since R works with vectors, they can be size 0), and that they are not `NA`. I am not that familiar with the R interface.

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [20 August 2020 08:28 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/4 "2020-08-20T08:28:41Z")

</div>

For clarity, the issue is further followed up in [this](https://github.com/igraph/rigraph/issues/404) issue on GitHub.

---

<div class="post-metadata">

**Author:** ![clpippel](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@clpippel](https://igraph.discourse.group/u/clpippel)\
**Post date:** [20 August 2020 16:07 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/5 "2020-08-20T16:07:41Z")

</div>

Hallo Vincent,

As you can see I posted these issues on Github (rigraph).

I do not see much progress there. I am new and do not know how this is supposed to work.

Some errors for example from 2015 are still not fixed.

Regards,

Kees Pippel

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [25 August 2020 18:23 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/6 "2020-08-25T18:23:59Z")

</div>

Yes, I linked to the GitHub issue to make sure that other users of this forum are also able to see that the discussion is also taking place elsewhere.

> [@clpippel](#):
>
> I do not see much progress there. I am new and do not know how this is supposed to work.
> 
> Some errors for example from 2015 are still not fixed.

Yes, there are still quite some old issues that are still open. More recently the development has gathered pace again. However, we are only with a few developers, and these things take time unfortunately.

The bug that you identified should be addressed of course, but it is straightforward to work around it for the moment I think.

---

<div class="post-metadata">

**Author:** ![clpippel](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@clpippel](https://igraph.discourse.group/u/clpippel)\
**Post date:** [25 August 2020 20:20 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/7 "2020-08-25T20:20:04Z")

</div>

> [@vtraag](#):
>
> Yes, there are still quite some old issues that are still open.

In igraph/rigraph/issues I do not see any feedback like “bug”, “confirmed”, or “todo” as in igraph/igraph/. So the status of the issues is somewhat confused. If that is resolved I could process all the outstanding issues and see whether I can reproduce in my environment (W10).

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [26 August 2020 07:51 UTC](https://igraph.discourse.group/t/erratic-behaviour-of-make-empty-graph-null/388/8 "2020-08-26T07:51:21Z")

</div>

Yes, the triage of open issues in `rigraph` is something that should still be done. We started with a backlog of issues for the C core, because they were most pressing.

Some issues may already be solved in the latest development version, which relies on a recent version of the C core. You can install this from the `dev` branch (which is the default branch), follow the instructions in `CONTRIBUTING.md`. In short, after installation of the necessary packages, do:

```auto
system("git submodule init")
system("git submodule update")
system("make")
library(devtools)
install()
build()
test()

```

However, I have not tried to compile R packages under Windows, so it might be a bit more involved on Windows.

If you want to contribute, you can check whether some of the open issues are still a problem in the latest development version, if not, you can report it and we can close the issue.
