Skip to content

virbahu/abc-costing-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💰 ABC Costing Engine

Python License Topic Status

Activity-based costing engine for supply chain — allocating overhead to products based on actual resource consumption rather than volume


📋 Overview

Activity-Based Costing (ABC) revolutionized cost accounting by replacing arbitrary volume-based overhead allocation with causal cost assignment. In supply chains, ABC reveals the true cost-to-serve for each product, customer, and channel — often exposing that 20-30% of SKUs are unprofitable.

This engine implements a full ABC model: define activities (receiving, putaway, picking, packing, shipping), assign resource costs to activities via resource drivers, then allocate activity costs to cost objects (products, customers, orders) via activity drivers.

Key capabilities:

  • Multi-level activity hierarchy (unit, batch, product, facility)
  • Resource driver assignment (labor hours, machine hours, square footage)
  • Activity driver rates (cost per pick, cost per receipt, cost per order)
  • Product-level and customer-level profitability analysis
  • Comparison with traditional volume-based costing to reveal distortions

🏗️ Architecture

flowchart LR
    subgraph Resources
        R1[👷 Labor\n$500K]
        R2[🏢 Facility\n$300K]
        R3[🖥️ Systems\n$200K]
    end

    subgraph Activities
        A1[📥 Receiving]
        A2[📦 Picking]
        A3[📤 Shipping]
        A4[🔄 Returns]
    end

    subgraph Cost Objects
        P1[Product A\nTrue: $8.20]
        P2[Product B\nTrue: $28.40]
        P3[Product C\nTrue: $45.80]
    end

    R1 -->|Hours| A1
    R1 -->|Hours| A2
    R2 -->|Sq ft| A1
    R2 -->|Sq ft| A2
    R3 -->|Trans| A3
    R1 -->|Hours| A4

    A1 -->|$/receipt| P1
    A2 -->|$/pick| P1
    A2 -->|$/pick| P2
    A3 -->|$/shipment| P2
    A4 -->|$/return| P3

    style P1 fill:#c8e6c9
    style P2 fill:#fff9c4
    style P3 fill:#ffcdd2
Loading

❗ Problem Statement

The Cost Distortion Problem

Traditional costing spreads overhead evenly by volume. ABC assigns it by actual consumption:

Product Volume Traditional Cost ABC Cost Distortion
High-volume, simple 10,000 $12.50/unit $8.20/unit Over-costed by 52%
Low-volume, complex 500 $12.50/unit $28.40/unit Under-costed by 56%
Custom, expedited 100 $12.50/unit $45.80/unit Under-costed by 267%

The "peanut butter" problem: spreading costs evenly masks true profitability. High-volume products subsidize complex, low-volume products — leading to pricing mistakes and strategic misallocation.

"In ABC, costs are assigned based on causality, not convenience. The result often reveals that a company's most profitable-looking products are actually destroying value."


✅ Solution Methodology

  1. Activity Identification — Map all supply chain activities: receiving, inspection, putaway, storage, picking, packing, labeling, shipping, returns processing
  2. Resource Assignment — Assign resource costs (labor, space, equipment) to activities using resource drivers
  3. Activity Rate Calculation — Compute cost per activity driver unit: $/pick, $/receipt, $/pallet-month, $/order
  4. Cost Object Assignment — Allocate activity costs to products/customers based on their actual consumption of each activity
  5. Profitability Analysis — Compute true margin per product, per customer, per channel

💻 Quick Start

Prerequisites

Requirement Version
Python 3.8+
pip Latest

Installation

git clone https://github.com/virbahu/abc-costing-engine.git
cd abc-costing-engine
pip install -r requirements.txt

Usage

from abc_costing_engine import ABCEngine

engine = ABCEngine()

# Define activities and their cost drivers
engine.add_activity("picking", total_cost=200000, driver="picks")
engine.add_activity("receiving", total_cost=80000, driver="receipts")
engine.add_activity("shipping", total_cost=150000, driver="shipments")

# Assign product consumption
engine.assign("SKU-A", {"picks": 50000, "receipts": 200, "shipments": 8000})
engine.assign("SKU-B", {"picks": 5000, "receipts": 100, "shipments": 500})

# Compute true product costs
for sku, cost in engine.compute().items():
    print(f"{sku}: ${cost['total_per_unit']:.2f}/unit | Margin: {cost['margin_pct']:.1f}%")

📦 Dependencies

numpy
pandas

📚 Academic Foundation

Based on Professor Professor Robert Kaplan, Harvard Business School
Key Reference Kaplan & Cooper (1998) Cost & Effect: Using Integrated Cost Systems to Drive Profitability and Performance. Harvard Business School Press.


👤 Author

Virbahu Jain — Founder & CEO, Quantisage

Building the AI Operating System for Scope 3 emissions management and supply chain decarbonization.

🎓 Education MBA, Kellogg School of Management, Northwestern University
🏭 Experience 20+ years across manufacturing, life sciences, energy & public sector
🌍 Scope Supply chain operations on five continents
📝 Research Peer-reviewed publications on AI in sustainable supply chains

📄 License

MIT License — see LICENSE for details.

Part of the Quantisage Open Source Initiative | AI × Supply Chain × Climate

Releases

No releases published

Packages

 
 
 

Contributors

Languages