An introduction to incidence matrices
Categories: Computer Science, MathematicsGiven a graph
, with
,
, we can define a matrix
, called
's incidence matrix, defined as such:
![\[
B_{i, j} = \begin{cases}
1, \text{ if edge} j \text{ is incident to node } i\\
0, \text{otherwise}
\end{cases}
\] \[
B_{i, j} = \begin{cases}
1, \text{ if edge} j \text{ is incident to node } i\\
0, \text{otherwise}
\end{cases}
\]](/static/latex/7bb9441c1cfe29e6d6382af5351eebc8.png)
In this post, we study some of this matrix's algebraic properties.
Given a graph
, with
,
, we can define a matrix
, called
's incidence matrix, defined as such:
![\[
B_{i, j} = \begin{cases}
1, \text{ if edge} j \text{ is incident to node } i\\
0, \text{otherwise}
\end{cases}
\] \[
B_{i, j} = \begin{cases}
1, \text{ if edge} j \text{ is incident to node } i\\
0, \text{otherwise}
\end{cases}
\]](/static/latex/7bb9441c1cfe29e6d6382af5351eebc8.png)
In this post, we study some of this matrix's algebraic properties.
Given a graph
, with
,
, we can consider the matrix
defined as such:
![\[
A_{i, j} = \begin{cases}
1, \text{ if } (v_i, v_j) \in E\\
0, \text{ otherwise }
\end{cases}
\] \[
A_{i, j} = \begin{cases}
1, \text{ if } (v_i, v_j) \in E\\
0, \text{ otherwise }
\end{cases}
\]](/static/latex/ef3d7c630e41268c7409b7023fb7ff35.png)
We call this the adjacency matrix. In this article we study some of its algebraic properties.
With the incredible usefulness of graphs and the amount of algorithms to solve graph problems, it is an important issue how we represent these graphs. In this post I will introduce a couple of ways of representing graphs on a computer, together with their advantages and disadvantages. In following posts I will discuss the interesting algebraic properties of the adjacency matrix, as well as some more advanced ways of representing graphs.
We'll turn to the two most used ones: adjacency matrices and adjacency lists. These are the "canonical" way of representing graphs. Both are quite simple data structures, yet ...
In this post I'll talk a bit about the functional programming technique called map.
The basic definition of it is easy enough: For every type a, b, given a list X of elements of type a, and a function f taking a and returning b, map f X gives you a list Y of elements of type b, where the i-th element of Y is the result of applying f to the i-th element of X.
Today I'd like to talk a bit about one of the most common operations in functional programming, a fold.