added graph visualization function;fix bug in max path length calculation
merge