Multi-granularity switch technologies decrease the control complexity and cost of optical cross-connects (OXCs) by employing waveband and fiber routing techniques. In this paper, we study the routing and resource assignment problem in multi-granular optical networks. A novel integrated multi-layer routing and resource assignment algorithm named Dynamic Minimum Weight (DMW) is proposed. With the DMW algorithm, waveband tunnel allocation problem and wavelength channel establishment problem can be settled simultaneously. Based on the proposed DMW algorithm, the network performance with different multi-granular OXC architectures are evaluated by simulation. The simulation results also demonstrate the effectiveness of the proposed DMW algorithm.