MCBA: A Matroid Constraint-Based Approach for Composite Service Recommendation Considering Compatibility and Diversity

Ying Sun,Xiao Wang,Hanchuan Xu,Zhongjie Wang
2024-09-03
Abstract:With the growing popularity of microservices, many companies are encapsulating their business processes as Web APIs for remote invocation. These lightweight Web APIs offer mashup developers an efficient way to achieve complex functionalities without starting from scratch. However, this also presents challenges, such as the concentration of developers'search results on popular APIs limiting diversity, and difficulties in verifying API compatibility. A method is needed to recommend diverse compositions of compatible APIs that fulfill mashup functional requirements from a large pool of candidate APIs. To tackle this issue, this paper introduces a Matroid Constraint-Based Approach (MCBA) for composite service recommendation, consisting of two stages: API composition discovery focusing on compatibility and top-k composition recommendation focusing on diversity. In the first stage, the API composition issue is formulated as a minimal group Steiner tree (MGST) problem, subsequently addressed by a "compression-solution" algorithm. In the second stage, a Maximum Marginal Relevance method under partition matroid constraints (MMR-PMC) is employed to ensure recommendation diversity. Comprehensive experiments on the real-world dataset show that MCBA surpasses several state-of-the-art methods in terms of accuracy, compatibility, diversity, and efficiency.
Software Engineering
What problem does this paper attempt to address?
### Problems the Paper Aims to Solve This paper aims to address the issue of recommending API combinations that meet composite service needs in the context of the increasing popularity of microservices. Specifically, the paper focuses on two main challenges: 1. **Compatibility**: Existing API recommendation methods often overlook compatibility checks between APIs, which may require developers to perform complex data format conversions during development. 2. **Diversity**: Existing recommendation methods tend to recommend popular APIs, which limits the diversity of the recommendation results, thereby affecting developers' ability to innovate and explore different functions and services. To address these challenges, the paper proposes a matroid-constrained approach (MCBA) for recommending API combinations that are both compatible and diverse. MCBA is divided into two stages: - **Stage 1: API Combination Discovery**: The API combination problem is modeled as a Minimum Group Steiner Tree (MGST) problem and solved using a "compress-decompress" algorithm. - **Stage 2: Top-k Combination Recommendation**: The Maximum Marginal Relevance with Partition Matroid Constraints (MMR-PMC) method is used to ensure the diversity of the recommendation results under partition matroid constraints. ### Main Contributions 1. **API Combination Problem Modeling**: The API combination problem is modeled as a Minimum Group Steiner Tree problem, and a "compress-decompress" algorithm is introduced to efficiently solve the keyword search problem while ensuring API compatibility. 2. **Ensuring Diversity**: The MMR-PMC method is proposed, combining diversity capture methods of "recommendation items from different categories" and "highest diversity score," while providing controllable diversity. 3. **Experimental Validation**: Comprehensive experiments on real datasets show that MCBA outperforms several state-of-the-art methods in terms of accuracy, compatibility, diversity, and efficiency, providing developers with more diverse, comprehensive, and efficient composite service recommendations. ### Summary By introducing the MCBA method, this paper addresses the issues of insufficient compatibility and diversity in existing API recommendation methods, providing developers with more efficient and personalized support for composite service development.