Multi-level marketing (MLM), or network selling, is a strategy for maximizing sales through a network of distributors. Distributors are paid commissions for personal sales and the sales of others they recruit. A hierarchy forms in which new recruits are placed under the distributors who recruit them, and commissions are paid several levels up. Consequently, the earlier a person joins, the larger his or her downline and potential commission will be.
MLM strategies come in different shapes and sizes and vary in sophistication. We implement one called the unilevel plan, which is easy to understand. Basically, distributors recruit as many as they can into their frontlines, and frontlines recruit as many as they can into second-lines, and so on. Further examples of MLM strategies are the binary plan, in which frontlines can have no more than two distributors apiece, and the forced matrix plan, which stipulates a maximum downline width and depth, for example 3x9. These two plans usually involve membership fees paid upline as new recruits spillover into leaf positions.
Figure 6-1 shows a visual depiction of different MLM compensation plans.
In this two-part article, we build a unilevel MLM engine using a persistent graph library called Neo4j ...