In mathematics, an incidence matrix is a logical matrix that shows the relationship between two classes of objects, usually called an incidence relation. If the first class is X and the second is Y, the matrix has one row for each element of X and one column for each mapping from X to Y. The entry in row x and column y is 1 if the vertex x is part of (called incident in this context) the mapping that corresponds to y, and 0 if it is not. There are variations; see below.