This is a preliminary version of the implementation of Jia Xu, Maxwell D. Collins, Vikas Singh. Incorporating User Interaction and Topological Constraints within Contour Completion via Discrete Calculus. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), June 2013. The graph construction code is partially based on Optimal Contour Closure by Superpixel Grouping. Alex Levinshtein, Cristian Sminchisescu, and Sven Dickinson. ECCV 2010. Crete, Greece. http://www.cs.toronto.edu/~babalex/closure_code.tgz To run our code, you will need CPLEX for solving our ILP. Please start with demo.m. For bug report, please contact jiaxu@cs.wisc.edu.