If someone knows a source with optimum distinguishing colors for a line-style graphic with 20 or so lines...
Wipneus, using the colours in going around a 'colour wheel' provides a partial solution, at least for graphs with up to 12 colours.
Interpolating to intermediate colours in an attempt to increase the number of colours doesn't work as the shades become too difficult to distinguish.
However, you can reasonably double the number of colours by also including a corresponding wheel of darker colours, where the colour values have been reduced in approximate proportion from those in the original colour wheel.
Attached is my suggestion for RGB colour values when doing graphs with up to 24 colours.