         VertexId        *d_column_indices;          // CSR format column indices on device memory
         SizeT           *d_column_offsets;          // CSR format column offset on device memory
         VertexId        *d_row_indices;             // CSR format row indices on device memory
+        SizeT           *d_in_degrees;              // array that stores the In-degree value for directed graph
+        SizeT           *d_out_degrees;             // array that stores the Out-degree value for directed graph and degree value for undirected graph
 
         //Frontier queues. Used to track working frontier.
         util::DoubleBuffer<VertexId, VertexId>      frontier_queues;

                                        graph_slices[0]->edges * sizeof(VertexId),
                                        cudaMemcpyHostToDevice),
                                    "ProblemBase cudaMemcpy d_row_indices failed", __FILE__, __LINE__)) break;
                    }

                } //end if(stream_from_host)

            if (d_column_indices)   util::GRError(cudaFree(d_column_indices), "GpuSlice cudaFree d_column_indices failed", __FILE__, __LINE__);
            if (d_column_offsets)   util::GRError(cudaFree(d_column_offsets), "GpuSlice cudaFree d_column_offsets failed", __FILE__, __LINE__);
            if (d_row_indices)      util::GRError(cudaFree(d_row_indices), "GpuSlice cudaFree d_row_indices failed", __FILE__, __LINE__);
            if (d_in_degrees)       util::GRError(cudaFree(d_in_degrees), "GpuSlice cudaFree d_in_degrees failed", __FILE__, __LINE__);
            if (d_out_degrees)      util::GRError(cudaFree(d_out_degrees), "GpuSlice cudaFree d_out_degrees failed", __FILE__, __LINE__);
            for (int i = 0; i < 2; ++i) {
                if (frontier_queues.d_keys[i])      util::GRError(cudaFree(frontier_queues.d_keys[i]), "GpuSlice cudaFree frontier_queues.d_keys failed", __FILE__, __LINE__);
                if (frontier_queues.d_values[i])    util::GRError(cudaFree(frontier_queues.d_values[i]), "GpuSlice cudaFree frontier_queues.d_values failed", __FILE__, __LINE__);
