As bipyridinium derivatives, the viologens are related to 4,4'-bipyridyl.  The basic nitrogen centers in these compounds are alkylated to give viologens:
:(CHN)  +  2 RX   →   [(CHNR)](X) 
The alkylation is a form of quaternization.  When the alkylating agent is a small alkyl halide, such as methyl chloride or methyl bromide, the viologen salt is often water-soluble.  A wide variety of alkyl substituents have been investigated.  Common derivatives are methyl (see paraquat), long chain alkyl, and benzyl.