Implement an iterative repair algorithm for a single-machine job scheduling problem. You are given a set of jobs, each with a processing time and a deadline, along with an initial ordering of jobs on the machine. The goal is to minimize total tardiness (the sum of how late each job finishes past its deadline).
The tardiness of a job is defined as max(0, completion_time - deadline). Jobs are processed sequentially in the given order on a single machine with no idle time.
Your algorithm should start from the initial schedule and iteratively improve it. In each iteration, evaluate all possible adjacent swaps (swapping the job at position i with the job at position i+1). Among all swaps that reduce the total tardiness, apply the one that achieves the greatest reduction. If no adjacent swap improves the total tardiness, or if the maximum number of iterations is reached, stop and return the current schedule along with its total tardiness.
Return a tuple of (final_order, total_tardiness) where final_order is a list of job indices and total_tardiness is an integer.