Aimed at the optimization problem of printed circuit board (PCB) assembly workshop (WPCBA) with multiple assembly machines and tasks, combined with polychromatic sets and genetic algorithm (GA), an optimization method is presented to optimize PCB assignment, component allocation and PCB assembly sequence problem simultaneously. On the basis of the polychromatic sets theory, numerical contour matrix is presented to describe the constraint of machine and operation sequence for WPCBA optimization problem and formulate the constraint model. Constraint model guarantees that GA searches optimal result in the effective solution space and simplify the calculation of fitness value. Moreover, if the machine and assembly task are changed, through a simple modification of constraint model, the WPCBA problem would be optimized conveniently. Computational results indicate that the solution efficiency of WPCBA optimization problem can be improved significantly and the dynamical optimization can be implemented.