# Check if vertex exists, create it if it doesn't--igraph is Much Slower than Networkx

**URL:** <https://igraph.discourse.group/t/check-if-vertex-exists-create-it-if-it-doesnt-igraph-is-much-slower-than-networkx/848>\
**Category:** Usage\
**Tags:** Python\
**Created:** [7 September 2021 08:42 UTC](https://igraph.discourse.group/t/check-if-vertex-exists-create-it-if-it-doesnt-igraph-is-much-slower-than-networkx/848 "2021-09-07T08:42:10Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![bairuofei](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/bairuofei/32/548_2.png) [@bairuofei](https://igraph.discourse.group/u/bairuofei)\
**Post date:** [9 September 2021 16:32 UTC](https://igraph.discourse.group/t/check-if-vertex-exists-create-it-if-it-doesnt-igraph-is-much-slower-than-networkx/848/5 "2021-09-09T16:32:27Z")

</div>

It is a good method to maintain an external set to record names of current vertices in the graph.

However, I find that it is not the essential part to influence the efficiency of adding new vertex to graph. As I have posted in [another topic](https://igraph.discourse.group/t/igraph-is-much-slower-than-networkx-when-generating-a-graph/853), the operation of adding vertices and edges to an existing graph in python-igraph is less efficient compared with networkx.

---

_[View the full topic](https://igraph.discourse.group/t/check-if-vertex-exists-create-it-if-it-doesnt-igraph-is-much-slower-than-networkx/848)._
