1. Adobe Commerce Developer Documentation
"Create a custom algorithm": "To create a custom source selection algorithm
you must create a module that implements the SourceSelectionInterface and register it in the di.xml file." This directly supports option A as the correct procedure.
Source: Adobe Commerce Developer Documentation > Inventory Management > Source selection > Create a custom algorithm.
2. Adobe Commerce Developer Documentation
"Source Selection Interface": The documentation for the Magento\InventorySourceSelectionApi\Api\SourceSelectionInterface specifies that it is the contract for Source Selection Algorithms. Any custom algorithm must implement this interface.
Source: Adobe Commerce Developer Documentation > Technical resources > Magento\InventorySourceSelectionApi\Api\SourceSelectionInterface.
3. Adobe Commerce Developer Documentation
"Distance Priority Algorithm": This document explains that the algorithm "calculates the distance between the shipping destination address and source locations" to determine the closest source. It makes no mention of incorporating delivery cost
confirming it does not meet the full requirement.
Source: Adobe Commerce Developer Documentation > Inventory Management > Distance Priority Algorithm.