  Synthesis is a major challenge in the discovery of new inorganic materials.
Currently, there is limited theoretical guidance for identifying optimal
solid-state synthesis procedures. We introduce two selectivity metrics, primary
and secondary competition, to assess the favorability of target/impurity phase
formation in solid-state reactions. We used these metrics to analyze 3,520
solid-state reactions in the literature, ranking existing approaches to popular
target materials. Additionally, we implemented these metrics in a data-driven
synthesis planning workflow and demonstrated its application in the synthesis
of barium titanate (BaTiO$_3$). Using an 18-element chemical reaction network
with first-principles thermodynamic data from the Materials Project, we
identified 82,985 possible BaTiO$_3$ synthesis reactions and selected nine for
experimental testing. Characterization of reaction pathways via synchrotron
powder X-ray diffraction reveals that our selectivity metrics correlate with
observed target/impurity formation. We discovered two efficient reactions using
unconventional precursors (BaS/BaCl$_2$ and Na$_2$TiO$_3$) that produce
BaTiO$_3$ faster and with fewer impurities than conventional methods,
highlighting the importance of considering complex chemistries with additional
elements during precursor selection. Our framework provides a foundation for
predictive inorganic synthesis, facilitating the optimization of existing
recipes and the discovery of new materials, including those not easily
attainable with conventional precursors.
