In Pakistan, hydroelectric power is one of the reliable sources of electricity with a capacity of 8,713 MW, which is 29% of the total energy mix. Hence, with such a vast resource capacity of hydroelectric power, its optimization and dispatch planning will have a great significance. This research work discusses the importance of hydroelectric power generation planning for both storage and run-of-river (ROR) hydropower plants, as well as; a solver-based optimization technique is proposed for the first time to resolve the intricate job of generation planning for hydroelectric power plants in MATLAB. A mathematical-optimization model is also developed, which uses a Mixed-Integer Linear-Programming (MILP) algorithm, based on the objective function of profit maximization, which considers a random varying revenue plan as model input. Three hydropower generators of different capacities and efficiencies are considered for the optimization problem. MILP based solution is proposed for both storage and ROR hydropower plants with two dispatch schedules, i.e., Normal dispatch schedule and optimum dispatch schedule. The objective functions are solved, and the profit (in dollars) from each dispatch schedule is calculated and compared. The preliminary optimization results show an increase of $22,000 and $29,130 in the profit for storage and ROR hydropower plants, respectively, which is 19% more than average income. Hence, ensuring the credibility of the proposed algorithm for maximizing the revenue ($), is aimed to facilitate and assist better planning for electric power producers.