Due to continuously increasing popularity of various network services the overall Internet traffic grows quickly. According to the recent Visual Networking Index report published by Cisco, the IP traffic will grow at a compound annual growth rate (CAGR) of 22 percent from 2015 to 2020. Space division multiplexing (SDM) in optical networks seems to be a promising solution with the scaling potential to overcome the possible capacity crunch problem in backbone networks. The key idea behind SDM is to exploit the spatial dimension to provide a significant increase in the transmission system capacity. The simplest version of SDM assumes the use of fiber-bundles composed of physically-independent, single-mode fibers. More advanced SDM deployments are based on multicore fibers (MCF) or multimode fibers (MMF). The main goal of this paper is to present integer linear programming (ILP) optimization models for flexgrid SDM optical networks. The proposed models reflect different ways of realizing SDM transmission, each characterized by different flexibility in the use of spatial and spectral resources. Since detailed ILP models precisely describing technological aspects of SDM may be difficult to solve due to their complexity, we provide an analysis of these issues. Eventually, we complement our study with a brief description of optimization algorithms that might be suitable for SDM optical networks.