We present an exact formula for the ordinary generating series of the simple paths between any two vertices of a graph. Our formula involves the adjacency matrix of the connected induced subgraphs and remains valid on weighted and directed graphs. As a particular case, we obtain a relation linking the Hamiltonian paths and cycles of a graph to its dominating connected sets.Keywords Directed graph · self-avoiding walks · simple cycles · Hamiltonian paths · dominating sets · labeled adjacency matrix 1 IntroductionCounting simple paths, that is trajectories on a graph that do not visit any vertex more than once, is a problem of fundamental importance in enumerative combinatorics [20] with numerous applications, e.g. in sociology [23,9]. Several general purpose methods for counting simple paths have been discovered over the last 60 years, which make use of the inclusion-exclusion principle [3,4,6,18,19] or variants such as finite-difference sieves [2] and recursive expressions involving the adjacency matrix [1,16,21,23]. More rare but also worth mentionning are approaches using different tools such as zeon algebras [24] or immanantal equations [10].While some of these theoretical results have been used to propose algorithms for counting simple cycles or paths of fixed length, the problem remains #W[1]-complete and is generally beyond reach of existing techniques