1. A method for optimizing electrodeposition process of vias, comprising: providing one or more critical parameters governing difficulty in achieving good via filling; selecting a representative via based on a value of a critical factor, which is a function of the critical parameters; obtaining a sampling point by an optimizer, wherein the sampling point comprises one or more sampling values of one or more process parameters; simulating a filling process of the representative via with the sampling point; calculating filling goodness of the simulated filling process; repeating the steps from obtaining the sampling point by the optimizer to calculating the filling goodness of the simulated filling process with other sampling points until all sampling points are processed; and generating a process window of the process parameters based on the calculated filling goodness.