implement f_func and g_fun methods in graph.py
Merge branch 'dev'