Finite-Horizon Optimal Control of Boolean Control Networks: A Unified Graph-Theoretical Approach

This paper investigates the finite-horizon optimal control (FHOC) problem of Boolean control networks (BCNs) from a graph theory perspective. We first formulate two general problems to unify various special cases studied in the literature: (i) the horizon length is $\textit{a priori}$ fixed; (ii) the horizon length is unspecified but finite for given destination states. Notably, both problems can incorporate time-variant costs, which are rarely considered in existing work, and a variety of constraints. The existence of an optimal control sequence is analyzed under mild assumptions. Motivated by BCNs' finite state space and control space, we approach the two general problems in an intuitive and efficient way under a graph-theoretical framework. A weighted state transition graph and its time-expanded variants are developed, and the equivalence between the FHOC problem and the shortest path problem in specific graphs is established rigorously. Two custom algorithms are developed to find the shortest path and construct the optimal control sequence with lower time complexity, though technically a classical shortest-path algorithm in graph theory is sufficient for all problems. Compared with existing algebraic methods, our graph-theoretical approach can achieve state-of-the-art time efficiency while targeting the most general problems. Furthermore, our approach is the first one capable of solving Problem (ii) with time-variant costs. Finally, the Ara operon genetic network in $\textit{E. coli}$ is used as a benchmark example to validate the effectiveness of our approach, and the results of two tasks show that our approach can dramatically reduce the running time.


I. INTRODUCTION
Boolean network (BN) was first proposed by Kauffman [1] to model gene regulatory networks, where each gene is assigned a Boolean variable to represent its expression state. The BN model has thereafter attracted increasing research interest in various fields, including studies on biomolecular networks in systems biology [2], therapeutic interventions in clinical treatment [3], and the contagion dynamics during a financial crisis [4], just to name a few. In a BN, the binary variables interact with each other through Boolean functions, and exogenous (binary) inputs can be injected into these functions to affect the network dynamics, which is commonly referred to as a Boolean control network (BCN) [5]. In this study, we focus on finite-horizon optimal control (FHOC) of BCNs, which is useful for optimal therapeutic intervention strategy design in medical applications [3]. Note that we view the finite horizon in a more general sense: either a fixed horizon length, or an unknown but finite horizon length with respect to a given destination state. These two types of FHOC problems are referred to as fixed-time optimal control and fixed-destination optimal control respectively in this paper.
In the last decade, a new matrix product called the semitensor product (STP), which can convert a BN (BCN) into an algebraic state-space representation (ASSR), has been developed by Daizhan Cheng et al. [6], [7]. The ASSR provides a systematic framework to study a wide range of control-theoretical problems related to BCNs, such as their controllability [5], observability [5], [8], stabilization [9], and various controller synthesis problems [10], [11], among others. A number of optimal control problems for BCNs have been investigated in recent years using the STP and ASSR tools as well. In [12], the Mayer-type optimal control problem (i.e., only terminal cost is considered) for single-input BCNs is addressed, and a necessary condition analogous to the Pontryagin's maximum principle is derived, which has been later extended to multi-input BCNs [13]. The minimum-energy control and minimum-time control of BCNs are investigated in [14] and [15] respectively. More general FHOC problems involving both stage cost and terminal cost are considered in [16], and the solution is given by a recursive algorithm as an analogy to the difference Riccati equation for discretetime linear systems. More recently, Ref. [17] targets the timediscounted stage cost and introduces a recursive algorithm based on a data structure called the optimal input-state transfer graph. The same problem is also investigated in [18], and a recursive solution for receding horizon optimal control of mixvalued probabilistic logical networks is obtained. In parallel to the study of FHOC problems, the more challenging infinitehorizon counterparts have also been attempted recently in several contributions using STP-based algebraic methods. For example, infinite-horizon optimal control with average cost is studied in [16], [19], [20], and the time-discounted cost case is examined in [17], [21], [22].
While we appreciate the above successes achieved with algebraic methods powered by the STP theory, one issue is that distinct methods are developed to solve different problems as reviewed above, even if we only consider FHOC. It appears that most existing work only deals with certain special cases of FHOC, for example, the minimum-energy control [14], the minimum-time control [15], the Mayer-type problem [12], the two kinds of Lagrange-type problems [23], and the time-discounted finite-horizon problem [18], though they may share a lot in common. As mentioned in [16] and arXiv:1908.02019v2 [math.OC] 31 Oct 2019 [24], there are many other types of FHOC problems as well as lots of practical limitations, for instance, optimal control subject to various constraints [24], [25], and more challenging problems with general time-variant costs. Consequently, a versatile approach instead of fragmented methods to solve all these common problems is highly desirable, which partly motivates this research. One goal of our study is to unify various tasks into an integrated framework and to develop systematic algorithms to handle the most general problems.
One serious concern about the algebraic approaches in BCN studies is the high computational complexity, since the number of operations grows exponentially with respect to the network size [5], [7], [11]. As a result, these approaches may quickly become computationally intractable as the number of state variables increase. In fact, most control-theoretical problems of BCNs are NP-hard [15] due to the combinatorial nature of Boolean state variables, i.e., a BCN with n variables has up to N := 2 n states, a phenomenon well-known as the curse of dimensionality, such as NP-hardness of controllability [26] and observability [8]. However, this doesn't mean we are hopeless: many algebraic approaches run in a high-order polynomial time in terms of N (see Table I for more details), which still leaves vast room for improvement by designing more efficient algorithms to decrease the order of the polynomial [9], [27]. This forms another objective of this research: we aim to reduce the computational complexity of FHOC for BCNs.
To pursue more efficient algorithms, we notice that a BCN is characterized by its finite state space, finite control space, and deterministic state transitions. A direct consequence of this property is that the dynamics of a BCN can be adequately described by a state transition graph (STG). Going further, methods originating from graph theory appear to be promising for investigations of BCNs. For example, computationally efficient methods for controllability [27], [28] and stabilization [9] of BCNs all resort to certain graph-theoretical algorithms. Regarding the optimal control of BCNs, a couple of pioneering studies exist that attempt to combine the ASSR with tools from graph theory to improve computational efficiency. A typical example is the employment of Floyd-like algorithms, inspired by the Floyd-Warshall algorithm in graph theory, in both finitehorizon minimum-energy control [14] and infinite-horizon problems [20], [21]. An update-to-date study [23] handles two kinds of Lagrange-type optimal control problems using the Dijkstra's algorithm instead. The above two algorithms are both initially developed to find shortest paths in a weighted graph. One limitation of both [14] and [23] is that they only consider time-invariant costs and a special class of FHOC problems. Motivated by these pioneering work borrowing tools from graph theory, we attempt to advance further and unify all common FHOC problems into an elegant and efficient graphtheoretical framework.
The contributions of this paper are listed in three folds. First, we unify all common types of FHOC problems, including time-variant costs and various constraints, into two general problems depending on whether the horizon length is prespecified, which are subsequently reduced to shortest path problems by constructing particular variants of the STG. The correctness of this reduction is proved rigorously. Existence of an optimal control sequence is analyzed under mild conditions for both problems. Second, we develop two intuitive algorithms to solve the above shortest path problems with superior efficiency. To be specific, only one algebraic method can achieve the same worst-case time complexity as ours, but our approach still tends to have better practical performance, which is demonstrated by two optimal control tasks for a genetic network in the bacteria E. coli. Third, as far as we know, there are currently no published results on the fixeddestination optimal control problem with time-variant costs, and our approach can handle it effectively using the identical graph-theoretical methodology.
The remainder of this paper is organized as follows. In Section II, we present some background knowledge about the STP, the ASSR, and the shortest path problem in graph theory. Section III introduces two general problems that can incorporate all specific FHOC problems studied in the current literature. In Section IV, the construction of the STG from a given initial state is discussed. After that, we detail the equivalence between the two FHOC problems and the shortest path problem in dedicated graphs and propose two efficient algorithms to solve them in Section V and VI respectively. The time complexity of our approach is compared with that of existent work in Section VII, and the practical running time of various methods to complete two tasks for the Ara operon network of E. coli is measured in Section VIII. Finally, Section IX gives some concluding remarks.

A. Notations
For statement ease, the following notations [6], [7] are used. 1) |S| denotes the size (i.e., cardinality) of a set S. 2) Let R and N denote the set of real numbers and nonnegative integers respectively. [l, r] := {l, l+1, · · · , r−1, r}. 3) f ≥ B means a function f is bounded below by B. 4) M p×q denotes the set of all p × q matrices. Given A ∈ 5) Col i (M ) denotes i-th column of a matrix M , and M ij denotes the (i, j)-th entry of M . 6) δ i n := Col i (I n ), where I n ∈ M n×n is the identity matrix. ∆ n := {δ i n |i = 1, 2, · · · , n}, and ∆ : where Blk i (A) ∈ M n×n is the i-th square block of A. 9) Logical operators [6]: ∧ for conjunction, ∨ for disjunction, ¬ for negation, and ⊕ for exclusive disjunction.

B. STP of Matrices and ASSR of BCNs
This section revisits some necessary background knowledge about the STP and the ASSR of BCNs developed by Daizhan Cheng et al. [5]- [7]. Definition 1: [19] The STP of two matrices A ∈ M m×n and B ∈ M p×q is defined by where ⊗ denotes the Kronecker product, and s is the least common multiple of n and p. Remark 1: The STP is essentially a generalization of the standard matrix product, and all major properties of the standard matrix product remain valid under STP [19]. Thus, we will omit the symbol in the remainder when no confusion is caused. That is, all matrix products refer to STP by default.
A logical function can be conveniently expressed in a multilinear form via STP. In this form, a Boolean value is identified by a vector as TRUE ∼ δ 1 2 and FALSE ∼ δ 2 2 . Lemma 1: [6] Given any Boolean function f (x 1 , x 2 , · · · , x n ) : ∆ n → ∆, there exists a unique matrix M f ∈ L 2×2 n , called the structure matrix, such that Interested readers may refer to [6] for computation of M f . For simplicity, set n i=1 A i := A 1 · · · A n . A general BCN Σ with n state variables (i.e., n nodes in the network) and m control inputs can be described as Σ : . Clearly, we have x(t) ∈ ∆ N and u(t) ∈ ∆ M , where N := 2 n and M := 2 m . N and M will be used through the whole text.
The ASSR of the BCN in (2) is given by [6], [14]: where L ∈ L N ×M N , named the network transition matrix,

C. Shortest Path Problem
The core of our graph-theoretical approach for FHOC is to transform the original problem into a shortest path problem in a particular graph and then locate the shortest path efficiently. We brief the shortest path problem in graph theory below. Given is a set of directed edges, we assign each edge a real value, called its weight or cost. Denote the weight of the edge from v i to v j by w(v i , v j ). Such a graph is known as a weighted directed graph. A path from a source vertex v i0 ∈ V to a destination vertex v i k ∈ V is a sequence of vertices connected by edges, denoted by p = v i0 , v i1 , · · · , v i k . Let (p) and |p| denote the number of edges and vertices in p respectively. If v i0 = v i k , p is a cycle. (p) is also called the length of p.
Definition 2: The weight w(p) of a path p is the sum of the weights of its constituent edges: A shortest path (SP) from v i0 to v i k is any path from v i0 to v i k with the minimum weight among all possible paths.

III. PROBLEM FORMULATION
Despite the variety of FHOC problems of BCNs studied in the literature [12]- [18], [23], they can essentially be classified into two general types according to whether the horizon length is a priori fixed or not. This section will detail the mathematical formulation of both general problems.

A. Fixed-Time Optimal Control
Roughly speaking, our objective is to construct a fixedlength control sequence for the BCN (3) to optimize a given performance index [16], [25]. The scenario can become much more complicated in practice because of various constraints when designing control strategies. For example, we have to avoid dangerous states in therapeutic intervention [3], [25]. Besides, not all theoretical control inputs are practically realizable, e.g., we may still lack effective means to manipulate specific genes in a GRN, or a medical treatment is possibly unaffordable. Consequently, certain control inputs can be unavailable or just prohibited in specific states [24]. Finally, it is common that we may want to steer the network to a particular state, e.g., to lead a gene regulatory network from a cancerous state (initial state) to a healthy state (terminal state) [29], [30]. Thus, we further enrich the fixed-time optimal control problem by constraining the terminal states.
A general problem reflecting the above intention subject to various constraints is formulated mathematically as follows.
Problem 1: Consider the BCN (3), an initial state x 0 ∈ ∆ N , and a fixed horizon length T ∈ N. Fixed-time optimal control of a BCN is to determine an optimal control sequence of length T to the following optimization problem: where u := (u(0), u(1), · · · , u(T − 1)) ∈ ∆ T M is a control sequence; g : ∆ N × ∆ M × N → R is the stage cost function; and h T : ∆ N → R is the terminal cost function. C x denotes the allowed states; C u represents the state-dependent constraints on control inputs; and the terminal set Ω ⊆ ∆ N denotes the set of desirable terminal states at time T .
Remark 2: The horizon length T denotes a finite treatment window in therapeutic applications [3], [25]. Thus, optimal therapeutic intervention strategies can be developed within a treatment window by setting up a proper optimality criterion J T in (5) by domain expert knowledge.
Few studies consider a time-dependent g but only in restricted forms such as the time-discounted cost in [17] and [18]. We intend to investigate the most general form (5) directly, where the stage cost g can incorporate time t in any form.
Problem 1 represents a very general setting of fixed-time optimal control problems. A variety of specific finite-horizon problems investigated in existing work can be rewritten easily into this general form. We demonstrate in the sequel how to specialize Problem 1 to some specific fixed-time optimal control problems with different characteristics in the literature.
For example, [17] and [18] consider the time-discounted finite-horizon optimal control, which can be expressed by (5) with g(x(t), u(t), t) = λ t c g (u(t), x(t)), where 0 < λ < 1 is the discount factor, and c g (·, ·) is a timeinvariant stage cost. As another example, the energy function in [14] is obtained through g(x(t), u(t), t) = u (t)Qu(t), and the more general quadratic cost function in [16] can be implemented straightforwardly by where Q h , Q, S, and R are proper weight matrices.

B. Fixed-Destination Optimal Control
A common task that Problem 1 cannot cover is time-optimal control, which aims to find a control sequence to drive the BCN from a given initial state x 0 to another destination state x d in minimum time. Such time-optimal control has been widely studied for traditional linear time-invariant (LTI) discrete-time systems, such as the famous deadbeat controller (see [31] for a review). In [15], the minimum-time control of BCNs is first investigated, and the same problem is considered again in [32] but with impulsive disturbances. Such optimality concept can be generalized to other criteria, for example, the minimum-energy control studied in [14], which attempts to steer the BCN to a target state using minimum energy.
Note that although the horizon length is not a priori fixed, it must be finite for a well-posed problem, that is, the specified destination state x d should be reachable from the initial state x 0 in finite steps. It is the main reason we consider such problems as another class of FHOC problems in a general sense. To further generalize this problem, just like Problem 1, we make it admit a set of destination states and subject to various constraints, which is formalized as follows.
Problem 2: Consider the BCN (3), an initial state x 0 ∈ ∆ N , and a terminal set Ω ⊆ ∆ N . The fixed-destination optimal control problem of a BCN is to determine an optimal control sequence of a variable length to the optimization problem, where u = (u(0), u(1), · · · , u(K − 1)) ∈ ∆ K M represents a control sequence, and K ∈ N indicates an unknown but finite horizon length. The terminal cost function h : ∆ N × N → R and the stage cost function g : and Ω denote the state constraint, the control constraint, and desirable destination states respectively.
Remark 4: Despite the apparent similarity in mathematical forms between Problem 1 and Problem 2, they will be treated by distinctly different means to maximize the computational efficiency of each problem. In existing work like [14] and [23], only specific problems with a time-independent stage cost function and a single destination state are investigated, and no terminal cost is considered. However, we argue that it is sensible to set different costs if the desired terminal state is reached at different time, for example, when the desired state refers to a good state of physical health.
Compared with the fixed-time optimal control (Problem 1), there are fewer studies on Problem 2. As far as we know, only the following two custom problems have been investigated in the literature, both with a single destination state, i.e., Ω = {x d }, and a time-invariant stage cost function.

IV. STATE TRANSITION GRAPH
In this section,we introduce the state transition graph (STG) of a BCN, which is useful for both Problem 1 and 2. An efficient algorithm based on bread-first search (BFS) [33] in a graph is developed to construct the STG.

A. Reachability of a BCN
To construct the STG, we need to first discuss the reachability of a BCN [5], [7], especially the reachable set of a given intial state, whose definition is given as follows.
Definition 3: The set of states that can be reached from R(x 0 ) can be obtained algebraically by calculating powers of the network transition matrix L [5], [7]. However, from a graph-theoretical view, a computationally economical way is to adopt the standard bread-first search (BFS) procedure to build R(x 0 ) iteratively [9], [33]. More interestingly, this method is closely related with the adjacency-list representation of a graph [33], and only requires successive computation of the one-step reachable set R 1 (·). Recall that u(t) ∈ ∆ M and x(t) ∈ ∆ N are both logical vectors with all zero entries except a single entry of value 1. Thus, given u(t) = δ k M , we have Lu(t) = Blk k (L). The following lemma follows immediately.
Lemma 2: The one-step reachable set of a state δ i N for a BCN (3) with no constraints is and, if there are constraints like Problem 1 (or Problem 2), Note that we ignore the terminal constraint in (8) and will handle it later when building specific graphs. It is possible that more than one control input can attain the transition from δ i N to δ j N . Collect these qualified control inputs into a set U ij : By Definition 3 and Lemma 2, the d−step reachable set of a state δ i N is obtained efficiently with the recursion:

B. Construction of an STG
As aforementioned, a BCN is characterized by its finite state space, where the finite control inputs coordinate the state transitions deterministically. This feature makes it possible to capture the complete dynamics of a BCN with a directed graph, called the state transition graph (STG).
Definition 4: Consider the BCN (3). Its state transition graph (STG) is a directed graph G = (V, E), where V = ∆ N is the vertex set, i.e., one vertex for each state, and the edge set is i.e., one edge for each one-step transition between states.
In this study, we only care about states reachable from an initial state x 0 . We denote such an STG by G = (V, E, x 0 ) with V = R(x 0 ). Hereafter we will use the terms vertex and state interchangeably when no ambiguity is caused.
In addition, we may assign a weight to each edge of the STG corresponding to the cost of the each state transition, which will be detailed in following sections.
Remark 5: The input-state graph (in a matrix form), proposed by [7], [21], uses an input-state pair (δ i M , δ j N ) as an vertex, leading to M N vertices in total. Our STG with only N or R(x 0 ) vertices is potentially more space and time efficient.
Note from (11) that R 1 (δ i N ) essentially denotes the successors of the vertex δ i N in the STG. We thus can build the STG following a BFS procedure and get R(x 0 ) at the same time. BFS is a graph traversal algorithm where the neighbors of a Append δ j N to Q and R vertex are visited in a FIFO (first-in-first-out) order. Algorithm 1 details the construction of an STG. Running Algorithm 1, we get the reachable set R(x 0 ), i.e., R in the algorithm, and the adjacency list of each vertex, R 1 (x), ∀x ∈ R(x 0 ), which effectively gives the STG G = (V, E, x 0 ) by Definition 4. Time complexity analysis of Algorithm 1. For each state δ i N ∈ R(x 0 ), Eq. (7) or (8)  Remark 6: Algorithm 1 implies that, any state x ∈ R(x 0 ) can be reached from x 0 in less than N steps, i.e., R(x 0 ) = ∪ 0≤d<N R d (x 0 ). This result is intuitive: if a trajectory from x 0 to x contains more than N states, there must be repetitive ones, and we can remove such cycles to shorten the trajectory.
Example 1: Consider a BCN with m = 2 control inputs and n = 3 state variables [14] as follows: Its ASSR (3) has a 8×32 transition matrix L, which is omitted here to conserve space. For illustration purpose, we set up the state constraints and control constraints arbitrarily below: i.e., the state δ 8 8 is forbidden; the control δ 2 4 is unavailable to all states; and only control {δ 3 4 , δ 4 4 } is applicable to state δ 6 8 . The STG G = (V, E, x 0 ) of Σ 1 with states reachable from x 0 = δ 1 8 subject to the given constraints (13) is obtained by Algorithm 1 and shown in Fig. 1.

V. SOLVE PROBLEM 1 VIA DYNAMIC PROGRAMMING
In this section, we first validate the existence of optimal solutions to Problem 1, and then we introduce a time-expanded variant of the STG and develop an efficient algorithm via dynamic programming to solve Problem 1 based on that graph.

A. Existence of Optimal Solutions
As we will discuss next, the stage costs and the terminal costs in (5) are mapped to edge weights of a graph to reduce Problem 1 to an SP problem. It is known that the SP problem is well defined only if the graph contains no negative-weight cycles [33]. Nonetheless, since the length of a path in Problem 1 is fixed due to the fixed horizon, this condition is no longer required. Only the following assumption is needed for Problem 1 to avoid an optimal value of negative infinity.
Assumption 1: The stage cost function g and the terminal cost function h T in Problem 1 are both bounded from below. Now we are ready to present the following conclusion about the existence of optimal solutions to Problem 1.
Proposition 1: Consider Problem 1 under Assumption 1. An optimal control sequence u * to (5) exists if and only if If Ω ∩ R T (x 0 ) = ∅, no feasible solutions exist for Problem 1, i.e., Problem 1 is infeasible. Thus, the necessity of Ω ∩ R T (x 0 ) = ∅ is obvious.
(Sufficiency) Note that the solution space U of Problem 1 is of finite size, which contains at most M T candidate solutions. Besides, Ω ∩ R T (x 0 ) = ∅ implies that at least one feasible solution u ∈ U exists which can steer the BCN from x 0 to a terminal state x f ∈ Ω at time T under constraints. Moreover, Assumption 1 ensures that J T (u) is bounded from below, ∀u ∈ U. A straightforward exhaustive enumeration of U can yield the optimal solution u * satisfying J T (u * ) = min u∈U J T (u).
Remark 7: If there are no constraints in Problem 1, i.e., an optimal control sequence always exists, which is widely studied in existing work, e.g., [17], [23]. Note additionally that the optimal control sequence u * may not be unique. Fig. 1 shows that each edge in the STG corresponds to a state transition of the BCN, whose weight indicates the transition cost. This fact motivates us to connect Problem 1 to the shortest-path (SP) problem on the STG. However, in contrast to the standard SP problem in graph theory, Problem 1 poses three substantial challenges. First, the number of time steps is fixed to T , that is, we want only T -edge paths. Second, the stage cost function g is time-dependent, indicating that the edge weights may vary with time. Finally, there is an additional terminal cost given by h T . Consequently, the classic SP algorithms can no longer be applied. To overcome these obstacles, we get inspiration from the space-time network in dynamic transportation network studies [34] and propose a new graph called the Time-Expanded fixed-Time State Transition Graph (TET-STG), which attaches timestamp to state transitions by stretching the STG along the time dimension. Besides, we introduce a pseudo-state δ 0 N to handle terminal states and their costs. A formal definition is given below.

B. Time-Expanded Fixed-Time State Transition Graph
Definition 5: Consider Problem 1. The TET-STG G tet = (V, E, x 0 , T ) is a weighted directed graph constructed by: Note that a state may appear at multiple time points, but they are treated as distinctive vertices from a graph perspective. Denote the vertex representing the state δ where U ij is given in (9), and the unique vertex at time T + 1 refers to the pseudo-state δ 0 N,T +1 . Denote the control that achieves the weight (cost) in (14) by u ij t : Remark 8: We note a slight abuse of notations in the above: R t (x 0 ) includes time information implicitly, and thus V i ∩ V j = ∅, ∀i = j. Besides, recall Eq. (9): among the possibly nonunique control inputs that enable a state transition, we pick definitely the one of lowest cost in (14) for optimal control purpose. The role of the pseudo-state δ 0 N,T +1 is to incorporate the terminal cost into the graph at the pseudo-time T + 1.
Despite its seemingly complex definition, the TET-STG can be built handily by acquiring V 0 , E 0 , V 1 , · · · , E T −1 , V T successively similar to the BFS in Algorithm 1. In practical implementation, the one-step transition between states need to computed only once: supposing there is a transition (δ i N , δ j N ) in the STG, i.e., δ j N ∈ R 1 (δ i N ), if we have a vertex δ i N,t ∈ V t , then there exists a succeeding vertex δ j N,t ∈ V t+1 and an edge (δ i N,t , δ j N,t+1 ) ∈ E t in the TET-STG.
where Q = diag(2, 3, 1, 0) and R = diag(3, 5, 4, 0, 1, 3, 6, 0). Take the transition (δ 3 8 , δ 7 8 ) as an example. We have U 37 = {δ 1 4 , δ 3 4 }, which justifies the use of (15). The obtained TET-STG is shown in Fig. 2. Now it is clear that, though the stage cost function g itself is time-dependent, the weight of each edge in the TET-STG becomes time-invariant after we expand the STG along the time axis. Time-variant cost Fig. 2. TET-STG in Example 2 with the initial state x 0 = δ 1 8 (the orange circle). A circle labeled i at time t denotes a vertex δ i 8,t . We highlight the terminal states in Ω by gray circles and the pseudo-state δ 0 8 by a dashed circle and dashed edges. The annotation of each edge (k, w) means that this transition is achieved with control δ k 4 at a cost of w (i.e., the edge's weight). Note that the dashed edges going into the pseudo-state need no control.
Recall Proposition 1. From the construction of the TET-STG, it is clear that an optimal control sequence exists if V T = ∅, because each path from δ i0 N,0 to δ 0 N,T +1 yields a feasible solution to Problem 1, where δ i0 N = x 0 . As aforementioned, we will transform Problem 1 into an SP problem in the TET-STG. First, note that each one-step transition in the TET-STG is already attained with a minimum cost thanks to (14) and (15). A direct consequence is the following lemma whose correctness is intuitive.
where p is the corresponding path in the associated TET-STG, and . Proof: According to edge weights in (14) and the optimal one-step control in (15), the weight of the path p in (16) is From the definition of J T in (5), we have We can see that the correctness of Lemma 3 is obvious.
The following theorem establishes the connection between fixed-time optimal control and the SP in the TET-STG.
Theorem 1: Consider Problem 1 under Assumption 1 and suppose it is feasible. Given then the minimum value of the cost function (5) is J * T = w(p * ), and an optimal control sequence is Proof: Suppose the solution space of Problem 1 is U = ∅, and the set of paths from δ i0 N,0 to δ 0 N,T +1 in G tet is P. There holds P = ∅ because each state trajectory driven by u ∈ U corresponds to a path in P. Moreover, we have |P| ≤ |U| since different control sequences may lead to identical state trajectories (see (9)). As we have shown in the proof of Proposition 2, |U| is finite, which implies |P| is also finite. Additionally, Assumption 1 and Eq. (14) ensures that all edge weights in G tet are bounded from below, which guarantees w(p) is bounded from below for any p ∈ P because p has exactly T + 1 edges. Thus, there must exist a shortest path p * .
Given any u ∈ U, Lemma 3 tells that there exists p ∈ P such that J T (u) ≥ w(p) ≥ w(p * ). Furthermore, for the control sequence u * ∈ U in (18) that attains p * , it leads to a state trajectory s ∈ Ω according to the TET-STG in Definition 5. Thus, u * is a feasible solution to Problem 1. Furthermore, Lemma 3 states J T (u * ) = w(p * ). Hence, we have J T (u) ≥ J T (u * ), ∀u ∈ U.

C. Dynamic Programming (DP) in TET-STG
The problem following Theorem 1 immediately is how to locate an SP from δ i0 N,0 to δ 0 N,T +1 in the TET-STG efficiently (see (17)). Since the layered structure of the TET-STG doesn't contain any cycles, the classic SP algorithms [33] such as the Floyd-Warshall algorithm and the Dijkstra's algorithm can be applied directly. However, in view of the fixed horizon length in Problem 1, we propose a custom method based on dynamic programming (DP) to achieve better time efficiency, which can even beat the state-of-the-art Dijkstra's algorithm (Remark 10).
The intuition behind our DP approach is that any sub-path of an SP is itself an SP as well [33]. Such optimal sub-structure is a strong indicator that DP based methods are applicable. The following theorem formalizes this idea.
Theorem 2: Consider Problem 1 under Assumption 1 and suppose it is feasible. In its associated TET-STG G tet = (V, E, x 0 , T ) with x 0 = δ i0 N , let F (δ j N,t ) denote the weight of an SP from vertex δ i0 N,0 to vertex δ j N,t , ∀t ∈ [0, T + 1], and let P (δ j N,t ) denote the predecessors of δ j N,t in G tet : can be obtained by the following recursion: for t ∈ [1, T +1], and the base condition is F (δ i0 N,0 ) = 0. If p * is an SP from δ i0 N,0 to δ 0 N,T +1 , we have w(p * ) = F (δ 0 N,T +1 ). Proof: We first show the correctness of the recursion (20) by induction. Due to the layered structure of G tet , any vertex δ j N,t ∈ V can only be reached from a certain vertex δ i N,t−1 ∈ V in one step, t ≥ 1. Assume F (δ i N,t−1 ), t ≥ 1, represents the minimum weight from vertex δ i0 N,0 to vertex δ i N,t−1 . For any path from δ i0 N,0 to δ j N,t that passes δ i N,t−1 , its minimum weight is obviously F (δ i N,t−1 ) + w(δ i N,t−1 , δ j N,t ). Eq. (20) examines all such predecessors of δ j N,t , and the minimum value F (δ j N,t ) is clearly the minimum weight of any path from δ i0 N,0 to δ j N,t . Besides, for t = 0, the base case F (δ i0 N,0 ) = 0 is clearly true. Thus, we have verified that F (δ j N,t ) is the minimum weight of any path from δ i0 N,0 to δ j N,t . It implies directly that F (δ 0 N,T +1 ) is the weight of the SP p * from δ i0 N,0 to δ 0 N,T +1 . if F has the key (t, j) then Memoization 6: return F [(t, j)] 7: 10: if d < d * then 11: i * ← i, d * ← d Remark 9: Eq. (20) is essentially a form of the Bellman optimality equation, a widely applied tool in optimal control [3], though we state it from a graph-theoretical perspective.
Combing Theorem 1 and 2, we get the minimum cost J * T for Problem 1 by J * T = w(p * ) = F (δ 0 N,T +1 ). Nonetheless, we are more interested in the optimal control sequence u * that attains J * T . The key is to record the minimizer to (20): if δ j N,t is in an SP, then the minimizer δ i * N,t−1 must be in the SP as well. At last, p * can be reconstructed accordingly, followed by u * acquired with (18). Algorithm 2 implements the DP method by Theorem 2 to solve F (δ j N,t ) and to reconstruct the optimal control sequence. Note that, for maximal time efficiency, the predecessors (19) of each vertex are stored while building G tet .
Time complexity analysis of Algorithm 2. G tet has T + 2 layers with at most Z := |R(x 0 )| vertices per layer and at most M Z edges between any two successive layers. Like Algorithm 1, G tet is constructed via BFS in linear time O(T M Z). The core function of Algorithm 2, SHORTESTPATH, implements top-down DP via the memoization technique [33], i.e., storing results into F and retrieving the cached results if same inputs recur. Memoization can avoid repetitive computation [33], and accordingly each edge of G tet is processed only once. Remark 10: The recent work [23] establishes a weighted directed graph to formulate the k-edge shortest path problem as well. However, neither the time-dependent stage cost function nor the terminal constraint set is considered in [23]. Moreover, the work [23] directly applies the standard Dijkstra's algorithm, which is designed for general SP problems and less efficient than our Algorithm 2 in solving Problem 1, whose running time is O(T M N + T N log(T N )) instead.
VI. SOLVE PROBLEM 2 VIA DIJKSTRA'S ALGORITHM In this section, the existence of optimal solutions to Problem 2 is first examined. Then, we divide Problem 2 into two cases depending on whether cost functions are time-dependent. Both cases will be conquered by Dijkstra's algorithm, but different graph structures are constructed to maximize efficiency.

A. Existence of Optimal Solutions
Like Problem 1, we use the terminal costs and the stage costs of Problem 2 as the edge weights of specific graphs. However, the major difference is that the number of state transitions in Problem 2 is not fixed. Consequently, the condition that no negative-weight cycles exist in any state trajectory from x 0 to x d ∈ Ω is mandatory [33]; otherwise, the cost J can always be reduced by repeating a negative-weight cycle, and no SP exists. We thus require the following conditions to guarantee existence of optimal solutions to Problem 2.
Assumption 2: The cost functions in Problem 2 satisfy three conditions: (i) h is bounded from below; (ii) g is nonnegative; (iii) h and g are both nondecreasing with respect to time t, i.e., h(δ i The rationality of condition (i) is obvious, just like Problem 1, to ensure a finite optimal value. Condition (ii) can be technically relaxed to the nonexistence of negative-weight cycles, though it would be quite difficult to verify such a condition in practice because edge weights (i.e., stage costs) can vary with time. We can justify condition (iii) intuitively by imaging a special scenario. Suppose a state trajectory from x 0 to x d ∈ Ω contains a cycle of zero weight. Then a possible result is that the more cycling the BCN does along this cycle, the more the cost criterion J can be reduced, once g or h can decrease as time passes. Consequently, the optimal control sequence does not have a finite length. Note that if g and h do not depend on t, which is the most common case in the literature, condition (iii) is satisfied naturally.
Remark 11: Following [16], [17], we can always assume h is nonnegative without affecting the optimal solution. Supposing h is bounded from below by a constant B h , the optimal control sequence to (6) is the same one that minimizes J (u) = J(u)− B h , and we have a nonnegative terminal cost function now: The following proposition confirms the existence of an optimal solution to Problem 2 under the above conditions. Proposition 2: Consider Problem 2 under Assumption 2. There exists an optimal control sequence u * satisfying |u * | < |R(x 0 )| that minimizes (6) if and only if Ω ∩ R(x 0 ) = ∅.
Proof: (Necessity) Since R(x 0 ) denotes all states reachable from x 0 , no state x d ∈ Ω can be reached if Ω∩R(x 0 ) = ∅.
(Sufficiency) If Ω ∩ R(x 0 ) = ∅, there must exist control sequences that steer the BCN from x 0 to a state x d ∈ Ω. Suppose such a control sequence is u = u(t) k−1 t=0 , and the resultant trajectory is s = x(t) k t=0 , where x(0) = x 0 and x(k) = x d . Furthermore, we claim that if |u| = k ≥ |R(x 0 )|, there must exist a shorter control sequenceū such that |ū| < |R(x 0 )| and J(ū) ≤ J(u). This claim is proved below.
The above claim implies that it is enough to consider the candidate setŪ = {u||u| < |R(x 0 )|, u ∈ U} for an optimal solution, where U is the feasible set of Problem 2. Obviously, the setŪ is finite, and Assumption 2 guarantees J(u) is bounded from below, ∀u ∈Ū. Therefore, an optimal solution u * ∈Ū to Problem 2 must exist such that |u * | < |R(x 0 )|.

B. Case 1: Time-Invariant Stage Cost and Terminal Cost
In this case, neither g nor h of (6) depends on time t: the STG becomes a static graph, whose edge weights are permanently fixed. Furthermore, if there is only one destination state with zero terminal cost, Problem 2 degrades to a standard SP problem in the STG. This simplest case has been solved in [14], [15], [23]. We address the more general problems here, where multiple destination states with non-zero terminal costs are allowed. Following the same idea in solving Problem 1, we introduce an extra pseudo-state δ 0 N as well as the terminal set into the STG and term the new graph STG + .
Definition 6: Consider Case 1 of Problem 2. The extended state transition graph STG + , denoted by G + = (V, E, x 0 ), is an extension of the STG constructed as follows: 1) Build the STG G = (V, E, x 0 ) by Definition 4, and the weights are assigned like (14), though time-independent: 2) Add into G the pseudo-state δ 0 N and its incoming edges, Here α ∈ N is an arbitrary integer used as a placeholder. Since all edge weights of G + are time-invariant, we denote the weight and the associated control input of each edge (δ i N , δ j N ) ∈ E by w ij and u ij respectively. Of course, the incoming edges of δ 0 N needs on control input. Example 4: Consider Example 1 again: the BCN (12) is subject to the constraints (13). Suppose the desired terminal states are Ω = {δ 3 8 , δ 4 8 }, and the initial state is x 0 = δ 7 8 . We assign the following time-invariant cost: where Q = diag(2, 5, 1, 4, 1, 3, 6, 0) and R = diag (0, 3, 1, 4). The STG + of this case can be easily built on basis of the STG in Fig. 1 following Definition 6, which is shown in Fig. 3. As we see, the STG + is akin to the STG but with an additional pseudo-state and edge weights assigned.
To transform Problem 2 in this case into an SP problem in the STG + , we first give the following lemma.
Lemma 4: Consider Case 1 of Problem 2 under Assumption 2 with time-independent g and h. Given any control sequence u = (δ k0 M , δ k1 M , · · · , δ ) of an unknown length K that steers the BCN along a state trajectory s = (δ i0 where p is the corresponding path in the associated STG + , and J(u) = w(p) holds if δ kt M = u itit+1 , ∀t ∈ [0, K − 1]. Proof: With the edge weights given by Definition 6, the weight of the path p is Note that u itit+1 is the optimal control input to transit the BCN from δ it N to δ it+1 N in one step, i.e., g(δ it N , u itit+1 , t) ≤ g(δ it N , δ kt M , t), ∀t ∈ [0, K − 1]. Comparing w(p) with the cost J(u) in (6), Lemma 4 is obviously true.
The following theorem relates Case 1 of Problem 2 to the SP problem in an STG + . Theorem 3: Consider Case 1 of Problem 2 under Assumption 2 with time-independent g and h, and suppose it is feasible. In the STG such that the minimum value of the cost function (6) is J * = w(p * ). The corresponding optimal control sequence is Since the problem is feasible, there exists control sequences that steers the BCN from the initial state x 0 to a destination state x d ∈ Ω, implying that there exist paths from δ i0 N to δ 0 N in G + . Note that G + has no negative cycles because (i) Assumption 2 states g is nonnegative and (ii) the pseudostate δ 0 N has only incoming edges, whose weights assigned by h may be negative though. With this fact, we can easily show that an SP p * from δ i0 N to δ 0 N with at most |V | vertices exists following the cycle elimination procedure in Proposition 2. In fact, this is a fundamental theorem in graph theory [33].
Recall Lemma 4: given any feasible control sequence u, there exists a path p from δ i0 N to δ 0 N in G + such that J(u) ≥ w(p) ≥ w(p * ) = J(u * ). The above theorem holds clearly.
Theorem 3 has reduced Problem 2 with time-invariant costs to a regular single-pair SP problem [33] from x 0 to δ 0 N in the STG + . Since g is nonnegative and the pseudo-state δ 0 N has only incoming edges, We have discussed in Remark 11 that we can always assume h is nonnegative without loss of generality, though it is not mandatory. Since g is also nonnegative, the STG + has only nonnegative edge weights. The fastest known SP algorithm for such graphs is Dijkstra's algorithm [33].
We make two modifications to the normal implementation of Dijkstra's algorithm for this optimal control problem. First, like Algorithm 2, the vertices that compose the SP are recorded to reconstruct the optimal control sequence later. Second, we terminate the search process once vertex δ 0 N is reached because we are only interested in the SP from x 0 to δ 0 N . Algorithm 3 presents the modified Dijkstra's algorithm to solve Case 1 of Problem 2. Since Dijkstra's algorithm is a well-established SP algorithm in graph theory (see [33,Chapter 24] for details), the proof of its correctness is omitted here.
Time complexity analysis of Algorithm 3. A key data structure in Dijkstra's algorithm is the priority queue [33], in which each item has a priority and the one with highest (or lowest) priority is first served. If the priority queue is implemented with a Fibonacci heap, Dijkstra's algorithm has a running time of O(|E| + |V | log |V |) [33]. In the beginning, just like the STG, the construction of the STG Example 5: We test Algorithm 3 with Example 4. The optimal value is J * = 13 and the optimal control sequence is u * = (δ 1 4 , δ 3 4 , δ 1 4 ). The state trajectory of the BCN is thus s * = (δ 7 8 , δ 5 8 , δ 2 8 , δ 4 8 ). It is easy to verify in Fig. 3 that an SP from δ 7 8 to δ 0 8 is p * = δ 7 8 , δ 5 8 , δ 2 8 , δ 4 8 , δ 0 8 and w(p * ) = 13.
Algorithm 3 Fixed-destination optimal control with timeinvariant costs using modified Dijkstra's algorithm Input: L, h, g, C x , C u , Ω, and x 0 = δ i0 N in Problem 2 Output: The optimal control sequence u * and J * 1: Build the STG + G + = (V, E, x 0 ) by Definition 6 2: Create a min-priority queue Q and two dictionaries M, D 3: for all δ i N ∈ V do Set initial distances 4: Add i into Q with its priority D[i] 6: while |Q| > 0 do Continue until we reach δ 0 N 7: i ← extract the minimum-priority item from Q 8: if i = 0 then break end Early termination 9: for all j ∈ {j |(δ i N , δ j N ) ∈ E} do Append u ij (15) to u * except j = 0 19: j ← i 20: Reverse u * in place

C. Case 2: Time-Variant Stage Cost and Terminal Cost
As aforementioned, the classic SP algorithms will not work once the edge weights may vary with time. To the best of knowledge, there are still no published studies on fixeddestination optimal control of BCNs with time-varying costs. Recall the TET-STG proposed in Section V, and we naturally attempt to handle this time-variant case for Problem 2 in a similar way. However, one immediate difficulty is that, unlike Problem 1, the horizon length is not known beforehand, which prevents the reuse of the DP-based Algorithm 2 directly.
Hopefully, we may resort to Proposition 2 to overcome this obstacle: it is sufficient to consider only control sequences of size less than |R(x 0 )| to find the optimal one, though the exact length remains unknown. On the other hand, Algorithm 2 works once a horizon length T is given. A straightforward workaround that reuses Algorithm 2 to solve this case thus comes to our mind as follows.
• Step 2. Solve the problem obtained above with Algorithm 2 to get an optimal control sequence u * T , |u * T | = T . • Step 3. Repeat Step 1 and Step 2 for all possible T 's, and finally yield u * = arg min u * T (J(u * T )). The enumeration of all possible horizon lengths like Procedure 1 is essentially the idea underlying the algebraic approach [14] for minimum-energy control towards a given target state, though it only considers time-invariant stage cost. A similar idea is also adopted in [20] to detect the minimum averageweight cycle in the input-state space. However, such a some-what brute-force method is still inevitably computationally expensive, e.g., the running time is O(N 4 ) in [14], [20]. In our case, even though each subproblem for a specific T can be solved by the more efficient Algorithm 2, the overall time complexity of Procedure 1 is still as high as O(M N 3 ).
Since we only care about control sequences that has a size less than |R(x 0 )|, to further reduce the computational burden, we devise another approach by adapting the TET-STG to an unknown but limited horizon length. More interestingly, Algorithm 3 initially developed for Case 1 can be reused on the resultant graph. We call this new graph a Time-Expanded fixed-Destination State Transition Graph (TED-STG). It construction is similar to the TET-STG detailed as follows.
Definition 7: Consider Case 2 of Problem 2. The TED-STG G ted = (V, E, x 0 ) is a weighted directed graph constructed by: , and connect the terminal states in each layer to the pseudo-state δ 0 and the control enabling the transition from δ i N to δ j N at time t is also u ij t in (15). The weight of edges in E 0 is Remark 12: Since the destination (terminal) states may be reached at any time in an optimal trajectory, we package all such possibilities into E 0 . This greatly simplifies the problem: we only need to find an optimal path from δ i0 N,0 to δ 0 N . Accordingly, the time to reach the pseudo-state δ 0 N is not known in advance, and that is why it has no time subscript.
Just like the TET-STG, the edge weights in a TED-STG do not change with time, though the cost functions g and h are themselves time-dependent. The cost of a state trajectory is related with the weight of a path in the TED-STG as follows.
Lemma 5: Consider Case 2 of Problem 2 under Assumption 2. Given any control sequence u = (δ k0 M , δ k1 M , · · · , δ k K−1 M ) of length K < |R(x 0 )| that steers the BCN along a state trajectory s = (δ i0 N , δ i1 N , · · · , δ i K N ) with x 0 = δ i0 N and δ i K N ∈ Ω. There holds J(u) ≥ w(p), where p is the corresponding path from δ i0 N,0 to δ 0 N in the associated TED-STG, , ∀t ∈ [0, K − 1]. Lemma 5 can be proved easily in almost the same way as Lemma 3, which is omitted here. Now we are ready to solve Case 2 of Problem 2 by converting it to an SP problem in the TED-STG through the following theorem.
Theorem 4: Consider Case 2 of Problem 2 under Assumption 2 with time-dependent g and h, and suppose it is feasible. Given the initial state x 0 = δ i0 N , there exists an SP Proof: Since the problem is feasible, Proposition 2 implies there exists an optimal control sequence shorter than |R(x 0 )|. Thus, we can search U = {u||u| < |R(x 0 )|, u ∈ U} for an optimal one, where U is the feasible set of Problem 2. Now recall Lemma 5: given any u ∈ U , there exists a path p from δ i0 N,0 to δ 0 N in the TED-STG such that J(u) ≥ w(p) ≥ w(p * ). Besides, with the weight given by Definition 7, it is obvious that w(p * ) = J(u * ). Thus, the proof is complete.
Theorem 4 transforms Problem 2 with time-dependent cost functions into a standard single-pair (i.e., δ i0 N,0 to δ 0 N ) SP problem in the TED-STG. As discussed in Remark 11, we assume that h ≥ 0 without loss of generality. Since all edges of this graph have nonnegative weights, we can apply Dijkstra's algorithm again to identify the SP, which is the same as Algorithm 3 except that the TED-STG is used instead of the STG + . We detail this algorithm in the online supplementary material on ArXiv 1 (Algorithm S1) to conserve space here.
Time complexity analysis of Algorithm S1. Definition 7 tells that there are Z := |R(x 0 )| layers in the TED-STG. Each layer has at most Z vertices, and at most M Z edges exist between two consecutive layers. Besides, there are typically only few destination states, i.e., the number of incoming edges of the pseudo-state δ 0 N is O(Z). We thus have |V | = O(Z 2 ) and |E| = O(M Z 2 ). Like a TET-STG, the TED-STG can be built quickly in linear time, i.e., O(|V | + |E|) = O(M Z 2 ). Thus, the time complexity of Algorithm S1 is dominated by the Dijkstra's SP part. To conclude, Algorithm S1 runs in time O(M Z 2 + Z 2 log Z 2 ) = O(Z 2 (M + 2 log Z)), which is much faster than the naive Procedure 1. Since we have Z ≤ N , the time complexity is equivalent to O(N 2 (M + 2 log N )).

VII. COMPARISON WITH RELATED WORK
As we have reviewed in Section I, unlike our algorithms which target the most general problems, most existing methods are developed for certain special cases of Problem 1 or Problem 2. We therefore categorize various optimal control tasks according to their characteristics to facilitate comparison. Their time complexity is summarized in Table I, where, as always, N = 2 n and M = 2 m for a n-state, m-input BCN, and T denotes the fixed horizon length in Problem 1.
To better interpret Table I, note that we can always assume M ≤ N because a state can transit to at most N succeeding states regardless of the number of control inputs. In fact, we usually have m < n and thus M N in practice especially for large networks. For example, it can be enough to steer the whole network by controlling only a fraction of the nodes [30], [35]. In short, Table I shows that our graph-theoretical approach can accomplish higher time efficiency than most existing approaches, and only methods in [16] and [23] share the same time complexity as ours for particular problems. Notably, if there are time-variant costs in Problem 2, only Algorithm S1 can handle it to the best of our knowledge. In summary, though we target FHOC problems ambitiously in their most general form, the computational efficiency of our approach is still superior to that of most existing work.
Note that the time complexity listed in Table I refers to the worst-case one, which indicates the longest running time of an algorithm given any possible input. By convention, the worst-case running time is used to measure the efficiency of algorithms [17], [22], [33]. A noteworthy point is that all the algebraic approaches in Table I, i.e., all existent work except [23], have their average-case time complexity equal to the worst-case one, because they essentially operate on matrices of identical sizes irrespective of the initial state x 0 and the size of its reachable set R(x 0 ). By contrast, as shown in time complexity analysis of our algorithms, the actual size of the graph depends on R(x 0 ), which is typically a small subset of the state space, while the algebraic methods always consider all the N states. Additionally, in constraint handling, our approach excludes the undesirable states and transitions completely from the graph, but most algebraic approaches simply assign them infinitely large cost values and still involve them in subsequent operations. Consequently, our graph-theoretical approach attains potentially lower averagecase time complexity than algebraic methods in practice, like [16], even though they share the same worst-case complexity.

VIII. A BIOLOGICAL BENCHMARK EXAMPLE
In this section, we focus on a larger BCN, i.e., the Ara operon gene regulatory network in E. coli that is responsible for sugar metabolism regulation [22], [36]. The main purpose is to compare the computational efficiency of various approaches. The Boolean model of this network is given in Table  II, where the target nodes indicate the 9 state variables, and the 4 control inputs are {A e , A em , A ra− , G e }. Interested readers may consult [36] for the biological meaning of these variables. Using the STP, we can get the ASSR of this network with a network transition matrix L ∈ L N ×M N , N = 512, M = 16.
To facilitate comparison with existing studies, we consider two tasks widely studied in the literature, i.e., the minimumenergy control and the minimum-time control. In both tasks, no constraints are enforced because only few existing methods consider state or input constraints. Suppose the initial state is x 0 = δ 9 512 and the desired state is x d = δ 410 512 for both tasks. All algorithms were implemented with Python 3.7. We did experiments on a desktop PC equipped with a 3.4 GHz Core i7-3770 CPU, 16 GB RAM, and Windows 10.

A. Task 1: Minimum-Energy Control
In this task, we aim to transfer the BCN from the initial state x 0 to the desired state x d at a prespecified time point with least energy consumption [14]. This task is presented as an instance of Problem 1 with T = 10 and Ω = {x d }. Since most methods can only deal with time-invariant costs, we use a stage cost function like that in [22] to evaluate the energy consumed by each state transition, and set zero terminal costs: Running Algorithm 2, we get the following results.
• The reachable set of x 0 , i.e., R(x 0 ), has only 108 states, though the complete state state has 512 states in total.
• The minimum value of J T (u) in (5) is J * T = 1108. • The optimal control sequence is u * = δ 16 (16,16,16,16,16,16,8,5,6,14), and the resultant state trajectory is s * = δ 512 (9,457,463,480,480,480,480,352,312,288,410). We illustrate R(x 0 ) and highlight the above optimal state trajectory s * in Fig. 5. We tested the other methods, and they all obtained the same optimal value J * T . The running time of different methods is listed in Table ??. As we have expected, the algorithm in [16] takes more time than ours in practice, though they have identical worst-case time complexity. The main reason is that the former always evaluates the whole state space, while our algorithm only focuses on the reachable states R(x 0 ). Another method [23] shares the same view as ours, but it depends on the slower Dijkstra's algorithm rather than the more efficient DP-based Algorithm 2. Overall, our approach attains the shortest running time to complete Task 1.

B. Task 2: Minimum-Time Control
This task is also referred to as time-optimal control, that is, to steer the BCN from x 0 to a desired state x d as fast as possible [15]. It is easy to specialize Problem 2 for this task: just let g(·, ·, ·) ≡ 1, i.e., unit time for each state transition,    h(·, ·) ≡ 0, and Ω = {x d }. In this setting, the optimal value J * of (6) is obviously the minimum time taken from x 0 to x d . Since g and h are both time-independent, we can tackle this task with Algorithm 3. The results are given below.
• The optimal value is J * = 3, i.e., the BCN is transferred from x 0 to x d in at least 3 steps.
• The optimal control sequence is u * = δ 16 (1,2,14), which leads to the state trajectory s * = δ 512 (9, 41, 15, 410). Like Task 1, we sketch the above minimum-time state trajectory in Fig. 5. The other methods yielded the same minimum time, and their running time is listed in Table ??. In this task, the method in [23] is essentially identical to ours, both depending on Dijkstra's algorithm to find an SP, and they are the fastest ones, taking far less time than the other two. Note that we have optimized it by building the STG efficiently with Algorithm 1 instead of the expensive algebraic method originally used in [23]. The algorithm in [14] is extremely slow here mainly because it examines exhaustively all SP's of length ranging from 1 to N to find the shortest one.
Remark 13: The running time of some algebraic approaches, like [17] and [15], might be further reduced using advanced numerical routines, since they depend heavily on matrix operations, and the involved matrices are typically sparse. Nevertheless, the results in Table ?? still demonstrate the supreme efficiency of our approach with an advantage of several orders of magnitude. Besides, the method in [23] is closest to ours, but it can only solve a small subset of problems investigated in this study. The Python implementation of the proposed approach and existing algorithms is available at GitHub https://github.com/ShuhuaGao/FHOC.

IX. CONCLUSION
This paper focused on FHOC of BCNs from a graphtheoretical perspective. We unified various kinds of specific FHOC problems into two general constrained optimization problems, which can incorporate time-variant costs and a diverse range of constraints. Then, as a central contribution of this study, we established equivalence between general FHOC problems and the SP problem in particular graphs. Two efficient algorithms were afterwards designed to find such an SP. As shown by both time complexity analysis and numerical experiments, our approach can handle the most general problems while maintaining a competitive advantage in computational efficiency. Finally, we note that all SP problems in Problem 1 and 2 can be technically solved by a single SP algorithm, like Dijkstra's algorithm, though we proposed two custom algorithms for efficiency purpose. That's why we consider our graph-theoretical approach as a unified framework, which is characterized by high computational efficiency and methodological consistency across a wide range of FHOC problems. Due to the discrete and deterministic nature of BCNs, we believe it is a promising research direction to hybridize the newly developed ASSR with the classical graph theory for more studies on BCNs beyond FHOC. One future work is to adapt this graph-theoretical approach to infinite-horizon optimal control problems.