A computer-implemented method of determining an order of execution of a neural network, the order of execution of the neural network performed by a processor when executing the neural network, the method comprising: obtaining, by one or more computing devices, data that describes a graph of the neural network, the neural network comprising a plurality of operators; obtaining, by the one or more computing devices, data indicative of an amount of available memory in a constrained memory space for use by the processor; and performing, by the one or more computing devices, at least one graph search algorithm on the graph to determine an order of execution of the plurality of operators that results in a memory usage that does not exceed the amount of available memory in the constrained memory space; wherein performing, by the one or more computing devices, the at least one graph search algorithm comprises: identifying, by the one or more computing devices, one or more forced transitions indicative of a transition between a first operator and a second operator, such that when the second operator is executed, the peak memory consumption associated with execution of the neural network does not increase; adding, by the one or more computing devices, the one or more forced transitions to the order of execution; and pruning, by the one or more computing devices, a search of a portion of the graph based at least in part on the identified one or more forced transitions. obtaining, by one or more computing devices, data that describes a graph of the neural network, the neural network comprising a plurality of operators; obtaining, by the one or more computing devices, data indicative of an amount of available memory in a constrained memory space for use by the processor; and performing, by the one or more computing devices, at least one graph search algorithm on the graph to determine an order of execution of the plurality of operators that results in a memory usage that does not exceed the amount of available memory in the constrained memory space; wherein performing, by the one or more computing devices, the at least one graph search algorithm comprises: identifying, by the one or more computing devices, one or more forced transitions indicative of a transition between a first operator and a second operator, such that when the second operator is executed, the peak memory consumption associated with execution of the neural network does not increase; adding, by the one or more computing devices, the one or more forced transitions to the order of execution; and pruning, by the one or more computing devices, a search of a portion of the graph based at least in part on the identified one or more forced transitions. identifying, by the one or more computing devices, one or more forced transitions indicative of a transition between a first operator and a second operator, such that when the second operator is executed, the peak memory consumption associated with execution of the neural network does not increase; adding, by the one or more computing devices, the one or more forced transitions to the order of execution; and pruning, by the one or more computing devices, a search of a portion of the graph based at least in part on the identified one or more forced transitions. <EOS>