Graph nodes' data stored along with names, function for probabilistic approach added