# Network Modeling of Murine Lymphatic System
## 3 Oriented Graph Model of Murine LS
### Computing the Direction of Lymph Flows  
As we aim to reproduce the target flow through thoracic duct \(q_{ld}=10\) mL/day (Table 1), we compute the flows in the left subgraph first. The pressure at the sink vertex is set to \(p_{out}=7.4\) cm H\({}_{2}\)O, and the outflow from the left LS subgraph to the left jugular vein \(q_{out}^{(l)}\) is calibrated so that the computed flow through thoracic duct (the edge incident to jugular vein) is equal to \(q_{ld}\). The inflows in the collecting lymphatics (inlet vertices with zero in-degree) are given to be the same and equal to \(q_{in}^{(l)}=q_{out}^{(l)}/n_{in}^{(l)}\), where \(n_{in}^{(l)}\) is the number of inlet vertices. After obtaining the flows in the left subgraph \(g_{l}\), we compute the flows in the right subgraph \(g_{r}\) by setting the same inflows \(q_{in}^{(r)}=q_{in}^{(l)}\) as in the left one, and the same output pressure \(p_{out}\). The outlet outflow is given by \(q_{out}^{(r)}=q_{in}^{(r)}n_{in}^{(r)}\).  
The distribution of the steady flows in the graph \(g(n,m)\) with \(n\) vertices and \(m\) edges is considered to be governed by the following:  
* The Hagen-Poiseuille equation \[q_{ij}=g_{ij}(p_{i}-p_{j})=\frac{\pi r_{ij}^{4}}{8\mu l_{ij}}(p_{i}-p_{j}),\] (1) links the flow \(q_{ij}\) through the edge \(e_{ij}\) with the drop of pressure from the tail \(i\) to the head \(j\) vertices (\(p_{i}-p_{j}\)) by the conductances \(g_{ij}\) that depend on lymph viscosity \(\mu\) and the radii and the lengths of the edges;
* The balance of flow through the vertices due to mass conservation: \[\sum_{j\in\mathcal{A}(i)}q_{ij}=\begin{cases}q_{int},&\text{if $i$ is inlet vertex}\\ -q_{out},&\text{if $i$ is outlet vertex}\\ 0,&\text{otherwise}\end{cases}\] (2) where \(\mathcal{A}(i)\) is a set of vertices adjacent to \(i\). Using the oriented incidence matrix \(M\in\mathbb{R}^{n\times m}\) and the diagonal conductance matrix \(G\in\mathbb{R}^{m\times m}\) (with elements indexed by edges rather than nodes), one can rewrite Equations (1) and (2) as \[q=-GM^{T}p,\quad Mq=-\hat{q},\] (3) where \(p\in\mathbb{R}^{n}\) are the nodal pressures, \(\hat{q}\in\mathbb{R}^{n}\) are the net flows through the vertices, and \(q\in\mathbb{R}^{m}\) are the flows through the edges. Hence, we get the linear system to solve for the nodal pressures: \[MGM^{T}p=Lp=\hat{q},\] (4) where \(L=MGM^{T}\) is a symmetric weighted Laplacian matrix. As at the outlet vertex the pressure is known (\(p_{out}\)), we substitute the vector \(\hat{p}=[0,\dots,p_{out},\dots,0]^{T}\) of zeros with the known pressure at the corresponding index in (4). By shifting \(L\hat{p}\) to the right-hand side, we obtain the system \[L_{rect}p_{unknown}=\hat{q}-L\hat{p},\] (5) where \(L_{rect}\) is the matrix L without the column corresponding to the index of the outlet vertex with known pressure. The pseudo-inverse of \(L_{rect}\) provides the vector of unknown pressures: \(p_{unknown}=L_{rect}^{+}(\hat{q}-L\hat{p})\). The graph was constructed and visualized using the R package \(igraph\). The algorithm for computing the flows described in Section 3.1 was implemented in R using the \(ginv()\) function for pseudo-inverse calculation from the MASS package. In addition, we have verified the computation of the flows in Julia language using the singular value decomposition to obtain the pseudo-inverse.  
An oriented graph of the murine LS resulting from the analysis of the global lymphatic flow balance is shown in Figure 1. It is derived assuming constant diameter of vessels in the LS.