Flexible job-shop scheduling problem (F-JSP) is an expansion of the job shop scheduling problem (JSP) which allows an operation to be fulfilled by any machine among a set of accessible machines at each stage. This paper investigates a no-wait F-JSP (NW-F-JSP) with machines accessibility restrictions for maintenance activities and machines processing capability to minimize total weighted tardiness. The study is organized in two phases. Firstly, a novel nonlinear mathematical model is developed for the supposed problem, and then it is converted into a linear mathematical model using techniques found in the literature. Since the structure of the problem is NP-hard, an imperialist competitive algorithm is proposed in the second phase to solve large instances of the problem. In the proposed algorithm, an effective solution representation with an efficient and greedy decoding methodology is adopted to reduce the search space. Numerical experiments are used to appraise the performance of the developed algorithm. It is inferred that in small instances, solving the mathematical model by GAMS leads to the optimal solution. Still, with an increased instance size, this method loses its efficiency and the ICA approach performs better under these conditions.