         adj_list[u].push_back(v);
         adj_list[v].push_back(u);
 
-        edge_count += 2;
-	}
-
-    int V_num = adj_list.size();
-    int E_num = edge_count;
+        edge_count++;
+    }
+
+    unsigned long long V_num = adj_list.size();
+    unsigned long long E_num = edge_count;
 
     std::cout << "Graph found with " << V_num << " nodes and " << E_num << " edges" << std::endl;
 

        for (int j = 0; j < adj_list[i].size(); j++) {
            E_u.push_back(i);
            E_v.push_back(adj_list[i][j]);
        }

        edge_index += adj_list[i].size();

    
    // Malloc GPU memory and store location in pointers
    cudaMalloc((void**)&V_ptr, V_size);
    cudaMalloc((void**)&E_ptr, E_size);
    cudaMalloc((void**)&E_u_ptr, E_size * 2);
    cudaMalloc((void**)&E_v_ptr, E_size * 2);
    cudaMalloc((void**)&outputs_ptr, outputs_size);

    // Copy data structures from main memory to allocated GPU memory
    cudaMemcpy(V_ptr, V.data(), V_size, cudaMemcpyHostToDevice);
    cudaMemcpy(E_ptr, E.data(), E_size, cudaMemcpyHostToDevice);
    cudaMemcpy(E_u_ptr, E_u.data(), E_size * 2, cudaMemcpyHostToDevice);
    cudaMemcpy(E_v_ptr, E_v.data(), E_size * 2, cudaMemcpyHostToDevice);
    cudaMemcpy(outputs_ptr, outputs.data(), outputs_size, cudaMemcpyHostToDevice);

    // Calculate number of blocks in CUDA grid based upon number of edges in graph
