Abstract With reference to huge investment needed for greenfield passive optical network (PON) deployment, it is immensely important to define procedures and algorithms aimed towards optimal layout and network planning to reduce the overall expenditure due to capital expenditure and operational expenditure as much as possible. We propose an integer linear programming (ILP) based optimization model that explores optimal network dimensioning and placement of network equipment at appropriate locations so as to minimize the overall expenditure. Based on the number of users [optical network units (ONUs)], user’s bandwidth demand, power budget, maximum distance from optical line terminal (OLT) to users, available number of wavelengths and OLT ports, and geographical locations of ONUs, OLT and candidate locations of remote nodes (RNs), the model selects the number, type, splitting ratio and locations of passive devices. The RN device type is selected to be either power splitter or array waveguide grating. Optimal PON architecture is appropriately identified to be time division multiplexing or time-and wavelength division multiplexing (TWDM) depending on the requirement. It provides complete interconnection details among all devices, the overall expenditure, the number of OLT ports and the number and associated data rates of wavelengths to be used. We show exhaustive results for two deployment regions (viz. urban and rural) with different number of ONUs and bandwidth demands from users.We also show result with actual locations of OLT, ONUs and RNs selected from Google map. The proposed ILP model has low computational complexity and offers optimal solution within a reasonable time limit, without requiring a heuristic approach that provides a sub-optimal solution. The TWDM-PON conforms to next-generation PON stage 2 (NG-PON2) specifications and can be used as a useful tool for setting up NG-PON2.