The present invention provides a method and apparatus to significantly accelerate the searching process based on the Monte Carlo principle and the lattice model. The device can operate in mode of resynchronization of the ventricular contractions, with an adjustable delay of inter-ventricular stimulation. The substrate includes a plurality of bonding pads on a first surface for electrical connection to other component.