The spectral theory of random walks on networks of arbitrary topology can be readily extended to study random walks and Lévy flights subject to resetting on these structures. When a discrete-time process is stochastically brought back from time to time to its starting node, the mean search time needed to reach another node of the network may be significantly decreased. In other cases, however, resetting is detrimental to search. Using the eigenvalues and eigenvectors of the transition matrix defining the process without resetting, we derive a general criterion for finite networks that establishes when there exists a non-zero resetting probability that minimizes the mean first passage time (MFPT) at a target node. Right at optimality, the coefficient of variation of the first passage time is not unity, unlike in continuous time processes with instantaneous resetting, but above 1 and depends on the minimal MFPT. The approach is general and applicable to the study of different discrete-time ergodic Markov processes such as Lévy flights, where the long-range dynamics is introduced in terms of the fractional Laplacian of the graph. We apply these results to the study of optimal transport on rings and Cayley trees.