compute a T-graph from given Kasteleyne matrix