delete all the warning. change the linkedhashSet to treeset in the
function buildGraph
update the buildGraph

change the linkedHashMap to treeMap