Local uniqueness under two directions in discrete tomography: A graph-theoretical approach