These materials are provided by the Supply Chain & Logistics Institute at the Georgia Institute of Technology. You are welcome to use them so long as the copyrights remain intact, credit for authorship is acknowledged, and nothing is resold at profit.

Affinity Analyzer

A tool for identifying skus that are ordered together

If your customers generally order an oil filter gasket when they order an oil filter, then you may be able to reduce travel in your warehouse by storing the filter and the gasket close to each other. This program identifies such opportunities.

You can search for such opportunities by preparing an order history that combines the shopping lists of recent customers and loading it into this program, which will read the orders, search for patterns, and report highly correlated skus. In addition, it will identify skus that tend to complete orders.

Run it from here!

Please read the license and disclaimers, then click to launch the latest version via Java Webstart: button to launch program

Note: Some firewall settings may prevent you from downloading the program.

If you are running the program for the first time, Java Web Start will download 1 program file totaling about 0.1MB. The next time you run the program Java Web Start will check for and download any upgrades before starting the program. If there have been no upgrades, the application will start immediately.

Need Java?

This program is written in Java so it runs on any brand computer and any operating system. If you do not already have Java installed, get the latest version of the Java Runtime Environment (JRE) here.

How to use the program

  1. Prepare an order history that lists all pick-lines, sorted by customer order. This should be a tab-delimited text file, with the order ID in the first field and the SKU in the second. (Here is an example.)
  2. Start the Affinity Analyzer program and open the the order history file. The program will parse the file and analyze the patterns of customer orders.
  3. Examine the statistics to find SKUs that have been ordered together.

Tips

You can find more information and tools like this in our textbook, Warehouse & Distribution Science and associated web page www.warehouse-science.com.

FAQ

Why does the program not look for groups of 3 or 4 or more skus that are frequently ordered together?
This is impractical and unnecessary. It is impractical because the time to process the sales history and the space to store the results both increase exponentially in the size of the affinity groups. It is unnecessary because, if a group of, say, 4 skus are frequently ordered together, this will be recognized by the current pairs analysis, which will report 6 pairs frequently ordered together.
Why do I get an out-of-memory error?
If your order history contains fifty thousand SKUs then the program must tabulate statistics on about (50 000)(50 000) = 2 500 000 000 different pairs of SKUs, which can overflow memory. But the program can take advantage of as much memory as you have available so quit other applications or move to a machine with more memory.
Why is the program taking so long to run?
Your computer does not have enough memory--see the previous question--and is continually swapping the contents of memory to disk (also known as “thrashing”). You must add more memory to your computer or use another computer that has more memory or truncate the data file (for example, use only the first 10 000 lines). For comparison, my laptop with 3GB RAM takes less than 1 minute to process 200 000 lines of sales history describing 10 000 SKUs.
Why didn't you implement this using VB within MS Excel?
Because embedded macros in MS Office products are a rich source of viruses; because macros in MS Office can be excruciatingly slow; because MS Excel costs money and does not run on Linux and so some people do not have it.