Looking in the Cura interface, I can set any whole number 0-100 for the infill percentage. Does Cura have an algorithm to calculate a pattern for any of those possible values, or does it have a few patterns where it selects the closest one?
Infill serves two main purposes. These don't seem to map particularly well to the available controls.
Adding strength to the part The more plastic your part has inside, the stronger it will be. At least, that is the simplistic assumption. In fact, it seems that infill is not a particularly effective way of strengthening a part (compared for example with thicker walls and structural design features). What is apparent is that some infill patterns are stronger in certain directions, some are more isotropic, and some are just weak.
Supporting upper layers Without infill, any top faces on a model will involve bridging, so there is a trade-off between infill density, the number of top layers, and the quality of the top surface of your print. To reflect this function, slicers allow you to incrementally increase the infill density as you approach a top surface. This is particularly useful in a model that has a large inner void which does not otherwise need to be filled.
In addition to affecting the infill strength, adjusting the infill pattern can influence the points at which infill connects to the walls. For complex shapes this might affect how successful the print is. There are also other parameters which you can adjust (overlap, orientation).
The 'best' infill settings are influenced by the requirements of infill, and the 'success' metric does not appear to have a sharp response that would be useful in performing an optimisation.
I fear I'm going to deny your question. The infil percentage and the infil pattern are two orthogonal properties, both of which contribute to the strength, density, mass, and print time of an object. Since there's no way for an algo to "know" what your desired outcome is, this can't be done.
Note - I used 'orthogonal' in the Hilbert sense, meaning neither property is a function of the other.
There is a option for the infill pattern. It is one of the MAAAAANY by default hidden options in Cura. On the Header of the cathegories there will appear a gear symbol while hovering over the header. By klicking it a window will show up and provides this many options to be shown in the settings, if they were checked.