added graph cut and unit-test

Add a function build_st_graph() for the rest of code in this function?