1. A method of speeding up computation of a minimum cut in a graph with a topology of an n-dimensional k-connected grid, wherein the computation is performed using a variant of the Boykov-Kolmogorov algorithm, the method comprising: determining the size of an n-dimensional rectangular block; padding the grid with a number of dummy nodes to make the extents of the grid evenly divisible by the size of the block in each dimension; dividing the grid into blocks of a determined size; representing the residual graph without explicit connectivity information, wherein the connectivity information is determined on the fly and is based on the graph's known regular structure; associating a set of fields with each node, wherein the fields comprise: residual capacities of the node's k outgoing edges; a residual capacity of the edge connecting the node to a terminal; a tree membership field indicating the node's membership to one of the search trees; an index of the node's parent node; an index of the edge connecting the node to its parent; and the node's timestamp; arranging the fields associated with each node into separate arrays, wherein each array corresponds to a single field and each array element corresponds to a single node; assigning an array index to each node based on the node's grid coordinates; defining a fixed ordering of the node's k outgoing edges; assigning an integer index to each of the node's k outgoing edges based on the fixed ordering; accessing the node's neighbors by computing the neighbors' array indices based on the index of the node; and accessing the reverse edge of a node's outgoing edge by determining the index of the neighbor's outgoing edge in the opposite direction.