Added graph display and weight and constraint construction.