diff --git a/src/utils/CSRGraph.hpp b/src/utils/CSRGraph.hpp
index 1581a85281006b4a78257db730610ae0cd9fb262..2ae461eb082b0822895fdf7fa835a27489557afa 100644
--- a/src/utils/CSRGraph.hpp
+++ b/src/utils/CSRGraph.hpp
@@ -10,6 +10,12 @@ class CSRGraph
   Array<int> m_neighbors;
 
  public:
+  size_t numberOfNodes() const
+  {
+    Assert(m_entries.size()>0);
+    return m_entries.size()-1;
+  }
+
   const Array<int>& entries() const
   {
     return m_entries;
@@ -28,7 +34,7 @@ class CSRGraph
       : m_entries(entries),
         m_neighbors(neighbors)
   {
-    ;
+    Assert(m_entries.size()>0);
   }
 
   CSRGraph() = default;