There are two common simplifying assumptions made in the scheduling of operations. One is that machines are available continuously, and the other is that once a job completes one process it is immediately available for its next. Moreover, in flowshops, it is commonly assumed that jobs must visit all machines. In practice, however, these assumptions may not be justifiable in some applications. This paper deals with a generalized flow shop (GFS) problem with machine availability constraints, transportation times between stages, and machine skipping. The electromagnetism-like method (EM) has been successfully applied to some NP-hard problems and this has motivated us to apply and assess the effectiveness of an EM algorithm in the GFS scenarios. Simulated annealing (SA) and a number of other well-recognized heuristics to the given GFS scheduling problem that minimizes two independent objective functions, namely the total tardiness and the total completion time also has been applied. In order to evaluate the performance of the proposed EM and SA, a set of practical instances has been considered. The related results are analyzed in two parts; in term of the objective functions, and the observed effects on variables in our instances. Extensive experiments and statistical analyses demonstrate that our proposed EM is more efficient than SA and other heuristics with regards to the objective functions considered in this paper.