Skip to content

Gawor270/BasketSplitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basket Splitter

Basket Splitter is a Java library that splits items in a customer's basket into delivery groups. The goal is to minimize the number of required deliveries and to create the largest possible delivery groups. My solution provides greedy approach that doesn't guarantee the optimal solution, but it is fast and provides good results in most cases and works way faster than the brute force or DP solution for input as big as 100 items.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Java 17 or 21
  • Gradle

Installing

  1. Clone the repository
git clone https://github.com/Gawor270/BasketSplitter
  1. Navigate into the cloned repository
cd BasketSplitter
  1. Build the project
./gradlew build

Usage

To use the BasketSplitter library, you need to create an instance of the BasketSplitter class and call the split method.

BasketSplitter splitter = new BasketSplitter("path/to/config.json");
List<String> items = Arrays.asList("item1", "item2", "item3");
Map<String, List<String>> result = splitter.split(items);

Running the tests

To run the tests, use the following command:

./gradlew test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages