1 Introduction
A homomorphism from a graph to a graph is a mapping such that for every . Graph homomorphisms generalise graph colourings (let be a complete graph) and have been intensively studied over a long period of time, both from a structural and an algorithmic perspective. We refer to the textbook of Hell and Nešetřil [44] for a further introduction.
We write if there exists a homomorphism from to ; here, is called the guest graph and is the host graph. We denote the corresponding decision problem by Hom, and if is fixed, that is, not part of the input, we write Hom. The renowned HellNešetřil dichotomy [42] states that Hom is polynomialtime solvable if is bipartite, and NPcomplete otherwise. We denote the vertices of by and call them colours. The reason for doing this is that graph homomorphisms generalise graph colourings: there exists a homomorphism from a graph to the complete graph on vertices if and only if is colourable.
Instead of fixing the host graph , one can also restrict the structure of the guest graph by bounding some graph parameter. A classical result states that Hom is polynomialtime solvable when the guest graph has bounded treewidth [16, 37]. The core of a graph is the subgraph of such that and there is no proper subgraph of with (the core is unique up to isomorphism [43]). Dalmau, Kolaitis and Vardi [18] proved that the Hom problem is polynomialtime solvable even if the core of the guest graph has bounded treewidth. This result was strengthened by Grohe [40], who proved that if , then Hom can be solved in polynomial time if and only if this condition holds.
Locally constrained homomorphisms. We are interested in three wellstudied variants of graph homomorphisms that occur after placing constraints on the neighbourhoods of the vertices of the guest graph . Consider a homomorphism from a graph to a graph . We say that is locally injective, locally bijective or locally surjective for if the restriction to the neighbourhood of is injective, bijective or surjective. We say that is locally injective, locally bijective or locally surjective if it is locally injective, locally bijective, or locally surjective for every . We denote these locally constrained homomorphisms by , and , respectively.
The three variants have been well studied in several settings over a long period of time. For example, locally injective homomorphisms are also known as partial graph coverings and are used in telecommunications [29], in distance constrained labelling [28] and as indicators of the existence of homomorphisms of derivative graphs [58]. Locally bijective homomorphisms originate from topological graph theory [4, 57] and are more commonly known as graph coverings. They are used in distributed computing [2, 3, 7] and in constructing highly transitive regular graphs [5]. Locally surjective homomorphisms are sometimes called colour dominations [52]. They have applications in distributed computing [12, 13] and in social science [26, 63, 66, 69]. In the latter context they are known as role assignments, as we will explain in more detail below.
Let LBHom, LIHom and LSHom be the three problems of deciding, for two graphs and , whether , or holds, respectively. As before, we write LBHom, LIHom and LSHom in the case where the host graph is fixed. Out of the three problems, only the complexity of LSHom
has been completely classified, both for general graphs and bipartite graphs
[32]. We refer to a series of papers [1, 6, 29, 31, 49, 50, 55] for polynomialtime solvable and NPcomplete cases of LBHom and LIHom; see also the survey by Fiala and Kratochvíl [30]. Some more recent results include subexponential algorithms for LBHom, LIHom and LSHom on string graphs [60] and complexity results for LBHom for host graphs that are multigraphs [51] or that have semiedges [9].In our paper we assume that both and are part of the input. We note a fundamental difference between locally injective homomorphisms on one hand and locally bijective and surjective homomorphisms on the other hand. Namely, for connected graphs and , we must have if or , whereas might be arbitrarily larger than if holds. For example, if we let be a complete graph, then holds if and only if contains a clique on at least vertices.
The above difference is also reflected in the complexity results for the three problems under input restrictions. In fact, LIHom is closely related to the Subgraph Isomorphism problem and is usually the hardest problem. For example, LBHom is Graph Isomorphismcomplete on chordal guest graphs, but polynomialtime solvable on interval guest graphs and LSHom is NPcomplete on chordal guest graphs, but polynomialtime solvable on proper interval guest graphs [41]. In contrast, LIHom is NPcomplete even on complete guest graphs , which follows from a reduction from the Clique problem via the aforementioned equivalence: holds if and only if contains a clique on at least vertices.
To give another example, LBHom, LSHom and LIHom are NPcomplete for guest graphs of pathwidth at most , and , respectively [15] (all three problems are polynomialtime solvable if is a tree [15, 33]). Note that these hardness results imply that the aforementioned polynomialtime result on Hom for guest graphs of bounded treewidth [16, 37] does not carry over to any of the three locally constrained homomorphism problems. It is also known that LBHom [48], LSHom [52] and LIHom [29] are NPcomplete even if is cubic and is the complete graph on four vertices, but polynomialtime solvable if has bounded treewidth and one of the two graphs or has bounded maximum degree [15].
An Application. Locally surjective homomorphisms from a graph to a graph are known as role assignments in social network theory. We will include this topic in our investigation and provide some brief context. Suppose we are given a social network of individuals whose properties we aim to characterise. Can we assign each individual a role such that individuals with the same role relate in the same way to other individuals with some role, using exactly different roles in total? To formalise this question, we model the network as a graph , where vertices represent individuals and edges represent the existence of a relationship between two individuals. We now ask whether has an role assignment, that is, a function that assigns each vertex a role , such that and for every two vertices and , if then .
Role assignments were introduced by White and Reitz [69] as regular equivalences and were called role colourings by Everett and Borgatti [26]. We observe that two adjacent vertices and may have the same role, that is, is allowed (so role assignments are not proper colourings). Hence, a connected graph has an role assignment if and only if for some connected graph with , as long as we allow to have selfloops (while we assume that is a graph with no selfloops).
The Role Assignment problem is to decide, for a graph and an integer , whether has an role assignment. If is fixed, we denote the problem Role Assignment. Whereas Role Assignment is trivial, Role Assignment is NPcomplete [66]. In fact, Role Assignment is NPcomplete for planar graphs [64], cubic graphs [65], bipartite graphs [62], chordal graphs [68] and split graphs [20]. Very recently, Pandey, Raman and Sahlo [61] gave an time algorithm for Role Assignment on general graphs and an time algorithm on forests.
Our Focus. We continue the line of study in [15] and focus on the following research question:
For which parameters of the guest graph do LBHom, LSHom and LIHom become fixedparameter tractable?
We will also apply our new techniques towards answering this question for the Role Assignment problem. In order to address our research question, we need some additional terminology. A graph parameter dominates a parameter if there is a function such that for every graph . If dominates but does not dominate , then is more powerful (less restrictive) than . We denote this by . If neither dominates nor dominates , then and are incomparable (orthogonal). Given the paraNPhardness results on LBHom, LSHom and LIHom for graph classes of bounded pathwidth [15], we will consider a range of graph parameters that are less powerful than pathwidth. In this way we aim to increase our understanding of the (parameterized) complexity of LBHom, LSHom and LIHom.
For an integer , a deletion set of a graph is a subset such that every connected component of has at most vertices. The deletion set number of a graph is the minimum size of a deletion set in . If , then we obtain the vertex cover number of . The deletion set number is also known as vertex integrity [23]. It is closely related to the fracture number , introduced in [24], which is the minimum such that has a deletion set on at most vertices. Note that holds for every integer . The feedback vertex set number of a graph is the size of a smallest set such that is a forest. We write , and for the treewidth, pathwidth and treedepth of a graph , respectively; see [59] for more information, in particular on treedepth. It is known that
where the second relationship is proven in [8] and the others follow immediately from their definitions (see also Section 2.2). It is readily seen that
and that is incomparable with the parameters , , and for every fixed (consider e.g. a tree of arbitrarily large pathwidth and the disjoint union of arbitrarily many triangles).
guest graph parameter  LIHom  LBHom  LSHom 

XP, W[1]hard [21]  FPT  FPT  
vertex cover number  XP (Theorem 5), W[1]hard  FPT  FPT 
deletion set number (fixed )  paraNPc (Theorem 5)  FPT  FPT 
fracture number  paraNPc  FPT (Theorem 4)  FPT (Theorem 4) 
treedepth  paraNPc  paraNPc (Theorem 6)  paraNPc (Theorem 6) 
pathwidth  paraNPc [15]  paraNPc [15]  paraNPc [15] 
treewidth  paraNPc  paraNPc  paraNPc 
maximum degree  paraNPc [29]  paraNPc [48]  paraNPc [52] 
treewidth plus maximum degree  XP, W[1]hard  XP [15]  XP [15] 
feedback vertex set number  paraNPc  paraNPc (Theorem 6)  paraNPc (Theorem 6) 
Our Results. We prove a number of new parameterized complexity results for LBHom, LSHom and LIHom by taking some property of the guest graph as the parameter. In particular, we consider the graph parameters above. Our two main results, which are proven in Section 4, show that LBHom and LSHom are fixedparameter tractable parameterized by the fracture number of . These two results cannot be strengthened to the treedepth of the guest graph, for which we prove paraNPcompleteness in Section 6. Note that the latter results imply the known paraNPcompleteness results for pathwidth of the guest graph [15]. In Section 6 we also prove that LBHom and LSHom are paraNPcomplete when parameterized by the feedback vertex set number of the guest graph. This result and the paraNPhardness for treedepth motivated us to consider the fracture number as a natural remaining graph parameter for obtaining an fpt algorithm.
The above paraNPcompleteness results for LBHom in fact even hold for FoldCover, the restriction of LBHom to input pairs where . The FoldCover problem was introduced in [7] (where it was called the Graph Covering problem). In fact, the aforementioned result of [15] on LBHom for pathwidth is the first proof that FoldCover is NPcomplete, and the proof can easily be adapted for , as observed by Klavík [47].
In Section 5 we prove that LIHom is in XP and W[1]hard when parameterized by the vertex cover number, or equivalently, the deletion set number for . We then show that the XPresult for LIHom cannot be generalised to hold for . In fact, in the same section, we will determine the complexity of LIHom on graphs with deletion set number at most for every fixed pair of integers and . Our results for LBHom, LSHom and LIHom are summarised, together with the known results, in Table 1.
Algorithmic Framework. The FPT algorithms for LBHom and LSHom are proven via a new algorithmic framework (described in detail in Section 3) that involves a reduction to an integer linear program (ILP) that has a wider applicability. To illustrate this, in Section 4 we also use our general framework to prove that Role Assignment is FPT when parameterized by . We emphasize that in our framework the host graph is not fixed, but part of the input, in contrast to other frameworks that include the locally constrained homomorphism problems (and that consequently work for more powerful graph parameters), such as the framework of locally checkable vertex partitioning problems [10, 67] or the framework of Gerber and Kobler [39] based on (feasible) interval degree constraint matrices.
Techniques.
The main ideas behind our algorithmic ILP framework are as
follows. Let and be the guest and host graphs, respectively.
First, we observe that if has a
deletion of size at most and there is a locally surjective
homomorphism from to , then must also have a
deletion set of size at most .
However it does not suffice to compute deletion sets
and for and , guess a partial homomorphism
from to , and use the structural properties of deletion
sets to decide whether can be extended to
a desired homomorphism from to . This is because
a homomorphism from to does not necessarily map to .
Moreover, even if it did, vertices in can still be mapped to vertices in .
Consequently, components of can still be mapped to more than one
component of . This makes it difficult to decompose the
homomorphism from to into small independent parts.
To overcome this challenge, we
prove that there are small sets and of vertices in and
, respectively, such that every locally surjective homomorphism
from to satisfies:

the preimage of is a subset of ,

is a deletion set for for some bounded in terms of only , and

all but at most components of have at most vertices and, while the remaining components can be arbitrary large, their treewidth is bounded in terms of .
As and are small, we can enumerate all possible homomorphisms from some subset of to . Condition 2 allows us to show that any locally surjective homomorphism from to can be decomposed into locally surjective homomorphisms from a small set of components of (plus ) to one component of (plus ). This enables us to formulate the question of whether a homomorphism from a subset of to a subset of can be extended to a desired homomorphism from to in terms of an ILP. Finally, Condition 3 allows us to efficiently compute the possible parts of the decomposition, that is, which (small) sets of components of can be mapped to which components of .
2 Preliminaries
We use standard notation from graph theory, as can be found in e.g. [19]. Let be a graph. We denote the vertex set and edge set of by and , respectively. Let be a set of vertices of . The subgraph of induced by , denoted , is the graph with vertex set and edge set . Whenever the underlying graph is clear from the context, we will sometimes refer to an induced subgraph simply by its set of vertices. We use to denote the subgraph of induced by . Similarly, for we let be the subgraph of obtained by deleting all edges in from .
For a graph and a vertex , we let and denote the open and closed neighbourhood of in , respectively. We let be the maximum degree of . Recall that we assume that the guest graph does not contain selfloops, while the host graph is permitted to have selfloops. In this case, by definition, if .
2.1 Parameterized Complexity
In parameterized complexity [17, 22, 35], the complexity of a problem is studied not only with respect to the input size, but also with respect to some problem parameter(s). The core idea behind parameterized complexity is that the combinatorial explosion resulting from the NPhardness of a problem can sometimes be confined to certain structural parameters that are small in practical settings. We now proceed to the formal definitions.
A parameterized problem is a subset of , where is a fixed alphabet. Each instance of is a pair , where is called the parameter. A parameterized problem is fixedparameter tractable (FPT) [17, 22, 35], if there is an algorithm, called an FPTalgorithm, that decides whether an input is a member of in time , where is a computable function and is the size of the input instance. The class FPT denotes the class of all fixedparameter tractable parameterized problems.
A parameterized problem is FPTreducible to a parameterized problem if there is an algorithm, called an FPTreduction, that transforms each instance of into an instance of in time , such that and if and only if , where and are computable functions. By fpttime, we denote time of the form , where is a computable function. Based on the notion of FPTreducibility, a hierarchy of parameterized complexity, the Whierarchy , where for all , has been introduced, in which the th level W[0] is the class FPT. The notions of hardness and completeness have been defined for each level W[] of the Whierarchy for [17, 22]. It is commonly believed that (see [17, 22]). This assumption has served as the main working hypothesis of fixedparameter intractability. The class XP contains parameterized problems that can be solved in time, where is a computable function. It contains the class W[t], for all , and every problem in XP is polynomialtime solvable when the parameter is bounded by a constant. The class paraNP is the class of parameterized problems that can be solved by nondeterministic algorithms in time, where is a computable function. A problem is paraNPhard if it is NPhard for a constant value of the parameter [35].
2.2 Graph Parameters
A extended deletion set for is a set such that:

every component of either has at most vertices or has a deletion set of size at most and

at most components of have more than vertices.
We need the following wellknown fact: [[53]] Let be a graph and let and be natural numbers. Then, deciding whether has a deletion set of size at most is fixedparameter tractable parameterized by .
Treedepth.
Treedepth is closely related to treewidth, and the structure of graphs of bounded treedepth is well understood [59]. A useful way of thinking about graphs of bounded treedepth is that they are (sparse) graphs with no long paths.
The treedepth of an undirected graph , denoted by , is the smallest natural number such that there is an undirected rooted forest with vertex set of height at most for which is a subgraph of , where is called the closure of and is the undirected graph with vertex set having an edge between and if and only if is an ancestor of in . A forest for which is a subgraph of is also called a treedepth decomposition, whose depth is equal to the height of the forest plus one. Informally a graph has treedepth at most if it can be embedded in the closure of a forest of height . Note that if is connected, then it can be embedded in the closure of a tree instead of a forest.
Treewidth.
A treedecomposition of a graph is a pair , where is a tree and is a function that assigns each tree node a set of vertices such that the following conditions hold:

For every edge , there is a tree node such that .

For every vertex , the set of tree nodes with induces a nonempty subtree of .
The sets are called bags of the decomposition and is the bag associated with the tree node . The width of a treedecomposition is the size of a largest bag minus . The treewidth of a graph , denoted by , is the minimum width over all treedecompositions of .
Relationships and Properties.
The following proposition summaries the known relationships between the parameters we consider.
[[59]] Let be a graph and let and be natural numbers. Then:

if has a deletion set of size at most , then .

if has a extended deletion set of size at most , then .

.
2.3 Locally Constrained Homomorphisms
We always allow selfloops for the host graph, but not for the guest graph (see also Section 1). Here we show some basic properties of locally constrained homomorphisms.
Let and be nonempty connected graphs and let be a locally surjective homomorphism from to . Then is surjective.
Proof.
Suppose not, and let be the set of vertices in . Note that (because otherwise is surjective) and (because is nonempty). Because is connected, there is an edge such that and . But then, the mapping is not surjective for any vertex . ∎
Let and be nonempty connected graphs with a homomorphism from to and let . Let and . If is a locally injective, surjective or bijective homomorphism, then is a locally injective, surjective or bijective homomorphism, respectively, from to .
Proof.
Clearly, is a homomorphism from to and since is a restriction of , it follows that if is locally injective, then so is . It remains to show that if is locally surjective, then so is . Suppose, for contradiction, that is locally surjective, but is not. Then there is a vertex such that . However, since does not map any vertex in to a vertex of , it follows that , so . Thus is not surjective, a contradiction. ∎
Let and be graphs, let , and let be a homomorphism from to . Then, for every component of such that , there is a component of such that . Moreover, if is locally injective/surjective/bijective, then is a homomorphism from to that is locally injective/surjective/bijective for every .
Proof.
Suppose for a contradiction that this is not the case. Then, there is a component of and an edge such that and are in different components of . Therefore, , contradicting our assumption that is a homomorphism.
Towards showing the second statement, first note that is a homomorphism from to . Moreover, for every vertex , so if is locally injective/surjective/bijective for a vertex , then so is . ∎
The following lemma is a basic but crucial observation showing that if and has a small deletion set, then so does . Let and be nonempty connected graphs, let be a deletion set for , and let be a locally surjective homomorphism from to . Then is a deletion set for .
Proof.
Suppose not, then there is a component of such that . By Observation 2.3, it follows that is surjective and therefore is defined. Let . Then and therefore is in some component of . Observation 2.3 implies that is a homomorphism from to that is locally surjective for every .
Now , so there must be a vertex in . Because is connected, there is an edge such that and . But then, the mapping is not surjective for any vertex . ∎
2.4 Integer Linear Programming
Given a set of variables and a set of linear constraints (i.e. inequalities) over the variables in with integer coefficients, the task in the feasibility variant of integer linear programming (ILP) is to decide whether there is an assignment of the variables satisfying all constraints in . We will use the following wellknown result by Lenstra [54].
3 Our Algorithmic Framework
In this section we present our main algorithmic framework that will allow us to show that LSHom, LBHom and Role Assignment are fpt parameterized by , whenever the guest graph has deletion set number at most . To illustrate the main ideas behind our framework, let us first explain these ideas for the examples of LSHom and LBHom. In this case we are given and and we know that has a deletion set of size at most . Because of Lemma 2.3, it then follows that if is a yesinstance of LSHom or LBHom, then also has a deletion set of size at most . Informally, our next step, which is given in Section 3.1, is to compute a small (i.e. with size bounded by a function of ) set of partial locally surjective homomorphisms such that (1) every locally surjective homomorphism from to augments some and (2) for every , the domain of is a extended deletion set of and the codomain of is a deletion set of , where is bounded by a function of . Here and in what follows, we say that a function augments (or is an augmentation of) a partial function , where and if and . This allows us to reduce our problems to (boundedly many) subproblems of the following form: Given a extended deletion set for , a deletion set for , and a locally surjective (respectively bijective) homomorphism from to , find a locally surjective homomorphism from to that augments . In Section 3.2 we will then show how to formulate this subproblem as an integer linear program and in Section 3.3 we will show that we can efficiently construct and solve the ILP for this subproblem. Importantly, our ILP formulation will allow us to solve a much more general problem, where the host graph is not explicitly given, but defined in terms of a set of linear constraints. We will then exploit this in Section 4 to solve not only LSHom and LBHom, but also the Role Assignment problem.
3.1 Partial Homomorphisms for the Deletion Set
For a graph and we let . The aim of this subsection is to show that there is a small set of partial homomorphisms such that every locally surjective (respectively bijective) homomorphism from to augments some and, for every , the domain of is a extended deletion set for of size at most and its codomain is a deletion set of size at most for . The main idea behind finding this set is to consider the set of high degree vertices in and , i.e. the sets and . As it turns out (see Lemma 3.1), for every subset , is a extended deletion set for of size at most and is a deletion set for of size at most , where . Moreover, as we will show in Lemma 3.1, every locally surjective (respectively bijective) homomorphism from to has to augment a locally surjective (respectively bijective) homomorphism from some induced subgraph of to . Intuitively, this holds because for every locally surjective homomorphism, only vertices of high degree in can be mapped to a vertex of high degree in and for every vertex in , there must be a vertex in that is mapped to it. Let be a graph. If has a deletion set of size at most , then the set is a deletion set of size at most . Furthermore, every subset is a extended deletion set of .
Proof.
Let be a deletion set of of size at most . Then every vertex has degree at most , as each of its neighbours lies either in its own component of or in . Hence and therefore . Let be the components of that contain a vertex adjacent to a vertex in . Since and every vertex in has degree at most , we find that and . Since every component in is either contained in a component of or contained in , we find that is a deletion set.
Let . We will show that is a extended deletion set of . The components of that contain no vertices from are components of and thus have size at most . Consider a component of that contains at least one vertex from . Let . Every component of is a component of and thus has size at most . Moreover, has size at most . We conclude that every component of either has size at most or has a deletion set of size at most . Furthermore, since there are at most vertices in , and every component of that has size larger than must contain a vertex of , it follows that there are at most components of that have size larger than . This completes the proof. ∎
Using the above lemma, we now get to the most important result of this subsection, which informally speaking shows that there are only boundedly many possible preimages of the vertices in and, moreover, these preimages are subsets of .
Let and be nonempty connected graphs such that has a deletion set of size at most . If there is a locally surjective homomorphism from to , then there is a set and a locally surjective homomorphism from to such that augments . If is locally bijective, then and is a locally bijective homomorphism.
Proof.
By Lemma 3.1, is a deletion set of size at most . Furthermore, observe that for a locally surjective homomorphism from to , the inequality holds for every ( holds in the locally bijective case). Since is surjective by Section 2.3, this implies that (and if is locally bijective, then ). By Section 2.3, is a deletion set for . Let , so (note that if is locally bijective). Now is a surjective map from to . Furthermore, . Moreover, for every , , since . Furthermore, is a homomorphism from to because is a homomorphism. We argue that is locally surjective (bijective resp.) by contradiction. Suppose is not locally surjective. Then there is a vertex and a neighbour of such that . Since is locally surjective, there must be such that . This contradicts the fact that . Hence is a locally surjective homomorphism. In the bijective case we just need to additionally observe that restricted to the neighbourhood of any vertex must be injective. This completes the proof. ∎
Finally, we show that we can easily compute all possible preimages of in any locally surjective (respectively bijective) homomorphism from to . Let and be nonempty connected graphs and let be nonnegative integers. For any , we can compute the set of all locally surjective (respectively bijective) homomorphisms from to in time. Furthermore, .
Proof.
Let and suppose there is a surjective map . Then for every vertex , there must be a vertex such that . Therefore , so if this condition fails, then we can immediately return that .
Otherwise, for each vertex of , there are possible choices for where a map could map this vertex. We can list all of the at most resulting maps in time, and for each such map, we can check whether it is a locally surjective (respectively bijective) homomorphism in time. ∎
3.2 ILP Formulation
Bottom: a locally surjective homomorphism from a graph (left) to a graph (right), where is a deletion set. The extensions can be minimally Smapped to ; only can also be minimally Smapped to . Furthermore, and can each be weakly Smapped to some type in (respectively and ). Using pair and once is sufficient to ensure that the mapping is locally surjective for each a.
In this section, we will show how to formulate the subproblem obtained in the previous subsection in terms of an ILP instance. More specifically, we will show that the following problem can be formulated in terms of an ILP: given a partial locally surjective (respectively bijective) homomorphism from some induced subgraph of to some induced subgraph of , can this be augmented to a locally surjective (respectively bijective) homomorphism from to ? See the top of Figure 1 for an illustration of the subproblem for the simpler case when is a vertex cover of and we are looking for a locally bijective homomorphism. Moreover, we will actually show that for this to work, the host graph does not need to be given explicitly, but can instead be defined by a certain system of linear constraints.
The main ideas behind our translation to ILP are as follows. Suppose that there is a locally surjective (respectively bijective) homomorphism from to that augments . Because augments , Observation 2.3 implies that maps every component of entirely to some component of , moreover, is already locally surjective (respectively bijective) for every vertex . Our aim now is to describe in terms of its parts consisting of locally surjective (respectively bijective) homomorphisms from extensions of in , i.e. sets of components of plus , to simple extensions of in , i.e. single components of plus . Note that the main difficulty comes from the fact that we need to ensure that is locally surjective (respectively bijective) for every and not only for the vertices within the components of . This is why we need to describe the parts of using sets of components of and not just single components. However, as we will show, it will suffice to consider only minimal extensions of in , where an extension is minimal if no subset of it allows for a locally surjective (respectively bijective) homomorphism from it to some simple extension of in . The fact that we only need to consider minimal extensions is important for showing that we can compute the set of all possible parts of efficiently (see Section 3.3). Having shown this, we can create an ILP that has one variable for every minimal extension and every simple extension such that there is a locally surjective (respectively bijective) homomorphism from to that augments . The value of the variable now corresponds to the number of parts used by that map minimal extensions isomorphic to to simple extensions isomorphic to that augment . We can then use linear constraints on these variables to ensure that:
 (SB2’)

contains exactly the right number of extensions isomorphic to required by the assignment for ,
 (B1’)

contains exactly the right number of minimal extensions isomorphic to required by the assignment for (if is locally bijective),
 (S1’)

contains at least the number of minimal extensions isomorphic to required by the assignment for (if is locally surjective),
 (S3’)

for every simple extension of that is not yet used in any part of , there is a homomorphism from to some simple extension of in that augments and is locally surjective for every vertex in (if is locally surjective).
Together, these constraints ensure that there is a locally surjective (respectively bijective) homomorphism from to that augments . See also the bottom of Figure 1 for an illustration of the main ideas. We are now ready to formalise these ideas. To do so, we need the following additional notation.
Given a graph , an extension for is a graph containing as an induced subgraph. It is simple if is connected, and complex in general. Given two extensions of , we write if there is an isomorphism from to with for every . Then is an equivalence relation. Let the types of , denoted , be the set of equivalence classes of of simple extensions of . We write to denote the set of types of of size at most , so .
Given a complex extension of , let be a connected component of . Then has type if (depending on the context, we also say that the extension has type ). The typecount of is the function such that for is the number of connected components of with type (in particular if is simple, the typecount is for and for other types). Note that two extensions are equivalent if and only if they have the same typecounts; this then also implies that there is an isomorphism between the two extensions satisfying for every . We write if for all types . If is an extension of , we write for the set of types of and for the set of simple extensions of . Moreover, for , we write for the set of simple extensions in having type .
A target description is a tuple where is a graph, is an integer and CH is a set of linear constraints over variables , . Note that a typecount for is an integer assignment of the variables . A graph satisfies the target description if it is an extension of , for , and setting for all satisfies all constraints in CH.
In what follows, we assume that the following are given: the graphs , , an extension of , a target description , and a locally surjective (respectively bijective) homomorphism . Let be an extension of with and let ; note that we only consider , because we assume that is a type of a simple extension of a graph that satisfies the target description . We say can be weakly Smapped to a type if there exists an augmentation of such that is locally surjective for every . We say that can be Smapped (respectively Bmapped) to a type if there exists an augmentation of such that is locally surjective (respectively locally bijective). Furthermore, can be minimally Smapped (respectively minimally Bmapped) to if