a demo program of directed graph