On the connection of flow graphs and contingency tables