diff --git a/r2sol.cc b/r2sol.cc
index 869284f770b263b3cf5e1e617001ef2d409d3537..fd8bb2eef860089456c675fdb028f520cf42cb73 100644
--- a/r2sol.cc
+++ b/r2sol.cc
@@ -539,7 +539,7 @@ Xor128 xor128[MAX_NUM_THREADS];
 short int perm[MAX_NUM_THREADS][NMAX];
 char pused[MAX_NUM_THREADS][NMAX];
 
-#define MAX_HEAP_SIZE 20000
+#define MAX_HEAP_SIZE 100000
 
 struct HeapElement {
   short int t, node, t1, est_tmin;