I am using a matrix to represent an 'upstream' relation. so this:
$$a \longrightarrow b \longrightarrow c$$ (which is read "$a$ is upstream of $b$, $b$ is upstream of $c$") becomes: $$\begin{pmatrix} 0&1&1 \\ 0&0&1 \\ 0&0&0\end{pmatrix}$$
One of the requirements of this system is that the matrix be asymmetric (if $x$ is upstream of $y$ then $y$ cannot be upstream of $x$) and transitive (if $x$ is upstream of $y$ and $y$ is upstream of $z$ then $x$ is upstream of z). These two properties are easy to check: one can easily check symmetry (i.e. which elements are equal to 1 for both $M$ and $M^T$) and also transitivity (using this MSE question).
I am constructing these matrices from data that may be inconsistent or incomplete, so I need some tests to tell me where my matrix violates certain assumptions
One such assumption is that if any two elements $a$ and $b$ are 'between' two other elements $c$ and $d$, then either $a$ is upstream of $b$ or $b$ is upstream of $a$.
$$c \longrightarrow (a?/b?) \longrightarrow d$$
$$ (c,a) \land (c,b) \land (a,d) \land (b,d) \Rightarrow (a,b) \lor (b,a)$$
$$\begin{matrix} \\0&?&0&1 \\ ?&0&0&1 \\ 1&1&0&1 \\ 0&0&0&0 \end{matrix}$$
My question is this: Is there a way to easily test this last assumption using matrix operations? Or even better, find all entries which violate such an assumption? These matrices can be hundreds if not thousands of rows, so preferably something that doesn't require much iteration.