The ultimate pit limit optimization (UPLO) serves as an important step in the mine planning process. Various approaches of maximum flow algorithms such as pseudo-flow and push-relabel have been used for pit optimization, and have given good results. The Boykov-Kolmogorov (BK) maximum flow algorithm has been used in solving the computer vision problems and has given great practical results but it has never been applied in UPLO. In this work, we formulate and use the BK maximum flow algorithm and the push-relabel maximum flow algorithm in MATLAB Boost Graph Library within the MATLAB software in order to perform UPLO in two case studies. Comparing both case studies for the BK maximum flow algorithm and push-relabel maximum flow algorithm gives the same maximum pit values but the BK maximum flow algorithm reduces the time consumed by 12% in the first case and 16% in the second case. This successful application of the BK maximum flow algorithm shows that it can also be used in UPLO.