make sure the initialization of the global random seed will only be executed once.
fix the compile error in Graph.