# A Generalized Framework for the Estimation of Edge Infection Probabilities
## 2 Definitions
### General Inverse Infection Model  
The Generalized Inverse Infection Model formalizes the estimation of edge infection values as a general optimization problem by defining the inputs and outputs of this task and describing the relationship between the infection and edge infection estimation models [24; 25]. We assume that the underlying graph of the infection process is known. We also assume that we have observations on an infection process taking place in the network. The observations on the infection process are given in the form of \(\vec{\sigma}_{t}\in O\), where \(t\in T\) denotes a time stamp. Each \(\vec{\sigma}_{t}\) assigns an observation on the infection process at time step \(t\) to all nodes of the network. Set \(O\) contains all observations, and set \(T\) contains all time stamps. At least two observations are needed to provide a meaningful model, but otherwise, the number of observations required is not specified. Previous applications of the GIIM always considered observations to be available at all \(t\in T\)[24; 25]. Finally, we assume that we know the specific type of infection process taking place in the network, although in Section 5, we will discuss what happens if we relax this assumption. We define the inputs of the GIIM as follows: we have an unweighted graph \(G\), an infection model \(\mathcal{I}\), the set of sample times \(T\) and the observations on the infection process \(\vec{\sigma}_{t}\in O\) for all \(t\in T\), where \(O=Inf(G,W,\mathcal{I},T)\). We denote the unknown weight assignment to the edges of the graph by \(W_{G}:E(G)\mapsto[0,1]\), and for now, we assume \(\mathcal{I}\) to be any network-based infection model from Section 2.1. We can interpret \(Inf\) as a procedure that makes observations at time steps \(T\) on infection process \(\mathcal{I}\) taking place in graph \(G\) with edge weights \(w_{e}\in W,e\in E(G)\). We also define a difference function \(d\) that compares two observations: \(d(O_{1},O_{2})\). The task of the GIIM is to find an estimation \(W^{\prime}\) of \(W\) so that \(d(O,O^{\prime})\) between \(O\) and \(O^{\prime}=Inf(G,W^{\prime},\mathcal{I},T)\) is as small as possible: we are looking for an edge infection probability assignment that best explains the observations of the original infection process. Finally, we define the General Inverse Infection Model as:  
**General Inverse Infection Model:**_Given an unweighted graph \(G\), an infection model \(\mathcal{I}\), a set of sample times \(T\) and observations \(O=Inf(G,W,\mathcal{I},T)\), we seek the edge infection probability assignment \(W^{\prime}\) such that the difference \(d(O,O^{\prime})\) between \(O\) and \(O^{\prime}=Inf(G,W^{\prime},\mathcal{I},T)\) is minimal._  
The definition above defines the inverse infection task as an optimization problem: the minimization of the error between a reference and a computed observation. The optimization task itself would be an iterative refinement of the computed observation. The solution procedure proceeds as follows: begin with an initial weight configuration \(W^{\prime}_{0}\), run the infection model, extract observations \(O^{\prime}\), compute the error between \(O\) and \(O^{\prime}\), and then refine \(W^{\prime}\) and repeat the process until the error is less than an accuracy constant \(a\) selected by the user. Algorithm 1 summarizes the main components of the GIIM. The specific search strategy that we implement in this paper to refine \(W^{\prime}\) is the Particle Swarm Optimization method [26], but other methods may be selected if they follow the structure above. The search process can be easily implemented in a parallel way. Given multiple candidate weight configurations, multiple instances of the infection models can be computed independently of each other on multiple threads.