Check whether two vertices are connected using graph-tool on Python

Solution 1:

It is solved by checking the result of the function g.edge(v,u). If add_missing=False it just returns None whenever the edge does not exist. Thanks to @NerdOnTour for the comment