Interaction of solitary waves for the generalized KdV equation