By "alternatives" I mean (for the most part; see exception below) the "roles" corresponding to the files under /var/lib/dpkg/alternatives.
These roles include
awk
desktop-background
editor
global-assembly-cache-tool
haskell-compiler
infobrowser
java
w
www-browser
x-window-manager
zsh
among many others.
The one exception I have in mind is the role display-manager (aka login-manager), which, AFAICT, is not represented under /var/lib/dpkg/alternatives, but I'm very much interested in.
Given one of these roles, let's call it foo, I want to know all the available1 packages that can play foo, or, said more precisely, that provide an executable that can play foo.
Of course, I want to know both the package and the path to the relevant executable, since the latter is not always obvious from the former; e.g. for the role x-window-manager, one such package is fluxbox, while the "relevant executable" is /usr/bin/startfluxbox, and not /usr/bin/fluxbox.
(At least for the roles under /var/lib/dpkg/alternatives, packages providing such roles must be packaged in such a way that the alternatives manager can properly recognize them; that's my understanding, anyway. If so, I'm hoping that there is some automatic way to identify all the packages that provide a particular role.)
1 Available, that is, through the sources specified in my /etc/apt/sources* config.