mcpField
L
last-mile-delivery

last-mile-delivery

github.com/kishorkukrejaその他8472 回インストール3 週間前に更新
リポジトリ

last-mile-delivery について

都市物流の運営担当者向けに、ラストマイル配送を最適化するスキルです。配送密度、時間帯、マイクロフルフィルメント、複数の配送方式を扱い、コストと顧客体験の両立を支援します。

主な機能

  1. 01配送密度の改善策
  2. 02配送時間帯の最適化
  3. 03マイクロフルフィルメント拠点の立地検討
  4. 04クラウドソーシング配送と車両の評価
  5. 05ロッカー・受取拠点ネットワークの最適化

活用シーン

  1. 01配送密度に応じたサービスエリアの調整
  2. 02配送速度と時間帯コストの調整
  3. 03マイクロフルフィルメント拠点追加の評価
  4. 04初回配達失敗の低減と受取拠点の計画

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill last-mile-delivery

インストール後、Claude Code で/last-mile-deliveryを入力して読み込まれたか確認します。

詳細

ラストマイル配送

ラストマイル配送の運用と都市物流に精通しています。目標は、配送センターからお客様までの最終区間を最適化し、人口密度の高い都市環境でコスト効率と顧客満足度のバランスを取ることです。

初期評価

ラストマイル配送の運用を最適化する前に、以下を把握してください。

  1. サービスモデル

    • どのような配送ですか?(小包、食料品、レストラン、薬局)
    • サービスの約束事項は何ですか?(当日、翌日、時間指定)
    • お客様の期待は何ですか?(追跡、通知、配達写真)
    • 返品/リバースロジスティクスは必要ですか?
  2. 都市環境

    • 配送対象エリアはどこですか?
    • 都市の密度はどの程度ですか?(高密度都市、郊外、混在)
    • 交通パターンや渋滞の状況はどうですか?
    • 駐車やアクセスにどのような課題がありますか?
    • 建物の種類は何ですか?(戸建て、アパート、オフィス)
  3. 現在の運用

    • 1日あたりの配送件数はどのくらいですか?
    • 現在の配送1件あたりのコストはいくらですか?
    • 時間どおりの配送率はどのくらいですか?
    • 配送失敗率はどのくらいですか?
    • 顧客満足度のスコアはどうですか?
  4. 運用上の制約

    • 配送時間枠はどの程度ですか?(狭い/広い)
    • 車両の制限はありますか?(サイズ、排出ガス)
    • ドライバーの制約はありますか?(シフト、ギグワーカーか従業員か)
    • ハブ/配送拠点はどこにありますか?

ラストマイル配送フレームワーク

主要なパフォーマンス指標

1. コスト指標

  • 配送1件あたりのコスト:総コスト/完了した配送件数
  • 停車1回あたりのコスト:配送失敗を含む
  • ドライバーの時間あたりコスト:人件費+福利厚生
  • 車両の1マイルあたりのコスト:燃料、メンテナンス、減価償却
  • 荷物1個あたりのハブ/施設コスト:間接費の配賦

一般的なベンチマーク:

  • 高密度都市:配送1件あたり $4-8
  • 郊外:配送1件あたり $8-12
  • 地方:配送1件あたり $15-25
  • 当日配送の割増料金:+50-100%

2. サービス指標

  • 時間どおりの配送率:時間枠内に配達された割合(%)
  • 初回配達成功率:初回の試行で配達された割合(%)
  • 配送時間の正確性:実際の時間と約束した時間の比較
  • 顧客満足度:CSAT または NPS スコア
  • 荷物の状態:破損率

3. 効率指標

  • 1時間あたりの停車回数:ドライバーの稼働1時間あたりに完了した配送件数
  • ルートあたりの荷物数:平均ルート密度
  • ルート効率:実際の距離と最適な距離の比較
  • ドライバー稼働率:稼働時間/シフトの合計時間
  • 配送密度:1平方マイルあたりの配送件数

ラストマイル最適化戦略

1. 配送密度の向上

コンセプト:

  • 狭いエリア内の配送件数を増やすほど、配送1件あたりのコストが下がります
  • 密度はラストマイルの収益性を左右する最大の要因です

戦略:

import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull

class DeliveryDensityAnalyzer:
    """
    Analyze and optimize delivery density

    Higher density = more efficient routes and lower costs
    """

    def __init__(self, delivery_locations, orders_per_location):
        self.locations = np.array(delivery_locations)
        self.orders = np.array(orders_per_location)

    def calculate_density_metrics(self):
        """
        Calculate delivery density metrics

        Returns deliveries per square mile/km
        """

        # Calculate convex hull (service area)
        if len(self.locations) < 3:
            return {'error': 'Need at least 3 locations'}

        hull = ConvexHull(self.locations)
        service_area = hull.volume  # area in 2D

        total_deliveries = self.orders.sum()
        delivery_density = total_deliveries / service_area if service_area > 0 else 0

        return {
            'total_deliveries': total_deliveries,
            'service_area': service_area,
            'delivery_density': delivery_density,
            'num_locations': len(self.locations)
        }

    def identify_high_density_zones(self, radius=2.0):
        """
        Identify clusters of high delivery density

        These zones justify dedicated resources
        """

        from sklearn.cluster import DBSCAN

        # Cluster deliveries
        clustering = DBSCAN(eps=radius, min_samples=5).fit(self.locations)
        labels = clustering.labels_

        # Analyze clusters
        clusters = []
        for cluster_id in set(labels):
            if cluster_id == -1:  # Noise
                continue

            cluster_mask = labels == cluster_id
            cluster_locations = self.locations[cluster_mask]
            cluster_orders = self.orders[cluster_mask]

            # Calculate cluster metrics
            center = cluster_locations.mean(axis=0)
            total_orders = cluster_orders.sum()
            radius_from_center = np.max(
                np.linalg.norm(cluster_locations - center, axis=1)
            )
            area = np.pi * radius_from_center ** 2
            density = total_orders / area if area > 0 else 0

            clusters.append({
                'cluster_id': cluster_id,
                'center': center,
                'num_locations': cluster_mask.sum(),
                'total_orders': total_orders,
                'radius': radius_from_center,
                'density': density
            })

        return sorted(clusters, key=lambda x: x['density'], reverse=True)

    def recommend_density_improvements(self):
        """
        Recommend strategies to improve density
        """

        metrics = self.calculate_density_metrics()
        recommendations = []

        # Benchmark density (deliveries per sq mile)
        if metrics['delivery_density'] < 20:
            recommendations.append({
                'priority': 'High',
                'strategy': 'Focus marketing on underserved areas',
                'rationale': 'Density below 20 deliveries/sq mi is inefficient',
                'target': 'Increase to 30+ deliveries/sq mi'
            })

        if metrics['delivery_density'] < 50:
            recommendations.append({
                'priority': 'Medium',
                'strategy': 'Implement time-based incentives',
                'rationale': 'Encourage customers to cluster delivery times',
                'target': 'Increase deliveries per route by 20%'
            })

        # Check for sparse outliers
        clusters = self.identify_high_density_zones()
        if len(clusters) > 0:
            recommendations.append({
                'priority': 'High',
                'strategy': 'Focus on high-density clusters first',
                'rationale': f'Found {len(clusters)} high-density zones',
                'target': 'Prioritize service in dense clusters'
            })

        return recommendations

# Example usage
delivery_locations = np.random.rand(100, 2) * 10  # 100 locations in 10x10 grid
orders_per_location = np.random.poisson(3, 100)  # Poisson-distributed orders

analyzer = DeliveryDensityAnalyzer(delivery_locations, orders_per_location)
metrics = analyzer.calculate_density_metrics()
recommendations = analyzer.recommend_density_improvements()

print(f"Delivery density: {metrics['delivery_density']:.1f} deliveries/sq unit")
print(f"Recommendations: {len(recommendations)}")

密度向上の施策:

  • サービスエリアを縮小する(中核ゾーンに集中)
  • 時間帯別料金(特定の時間枠の利用を促す)
  • サービスが行き届いていないエリアで顧客を獲得する
  • 密度の低いエリアにはロッカー/受け取り拠点を設置する
  • 他の配送業者と提携する(ネットワークを共有)
2. 時間枠の最適化

課題:

  • 狭い時間枠はコストを押し上げます
  • 広い時間枠は顧客満足度を低下させます

バランスの取れたアプローチ:

import pandas as pd
from datetime import datetime, timedelta

class TimeWindowOptimizer:
    """
    Optimize delivery time windows

    Balance customer preference with operational efficiency
    """

    def __init__(self, historical_deliveries):
        """
        Parameters:
        - historical_deliveries: DataFrame with delivery data
          columns: ['customer_id', 'requested_window', 'actual_delivery',
                   'window_width_hours', 'successful']
        """
        self.deliveries = historical_deliveries

    def analyze_window_preferences(self):
        """
        Analyze customer time window preferences

        Returns distribution of preferred windows
        """

        # Extract hour from requested windows
        self.deliveries['preferred_start_hour'] = pd.to_datetime(
            self.deliveries['requested_window']
        ).dt.hour

        # Distribution by hour
        hourly_demand = self.deliveries.groupby('preferred_start_hour').size()

        return {
            'hourly_distribution': hourly_demand,
            'peak_hour': hourly_demand.idxmax(),
            'peak_demand': hourly_demand.max()
        }

    def calculate_window_efficiency(self):
        """
        Calculate efficiency by window width

        Wider windows = easier routing, but lower satisfaction
        """

        efficiency = self.deliveries.groupby('window_width_hours').agg({
            'successful': 'mean',  # Success rate
            'customer_id': 'count'  # Volume
        }).rename(columns={'customer_id': 'count', 'successful': 'success_rate'})

        return efficiency

    def recommend_window_strategy(self):
        """
        Recommend optimal window strategy

        Balance customer preference with operational needs
        """

        window_efficiency = self.calculate_window_efficiency()

        recommendations = []

        # Default: Offer 2-hour windows during peak times
        recommendations.append({
            'strategy': '2-hour windows during peak (10 AM - 6 PM)',
            'rationale': 'Balance efficiency and satisfaction',
            'expected_success_rate': 0.92
        })

        # Premium: 1-hour windows for higher fee
        recommendations.append({
            'strategy': '1-hour express windows (+$5 fee)',
            'rationale': 'Premium service for time-sensitive customers',
            'expected_success_rate': 0.85,
            'upcharge': 5.00
        })

        # Economy: 4-hour or all-day windows for discount
        recommendations.append({
            'strategy': '4-hour economy windows (-$2 discount)',
            'rationale': 'Flexible customers, easier routing',
            'expected_success_rate': 0.97,
            'discount': -2.00
        })

        return recommendations

    def dynamic_window_pricing(self, date, available_capacity):
        """
        Calculate dynamic pricing for time slots

        Surge pricing when capacity is constrained
        """

        # Predict demand for each time slot
        slots = [
            '8-10 AM', '10-12 PM', '12-2 PM',
            '2-4 PM', '4-6 PM', '6-8 PM'
        ]

        pricing = []

        for slot in slots:
            # Estimate demand (simplified - use ML in practice)
            base_demand = 100
            slot_demand = base_demand * np.random.uniform(0.7, 1.3)

            # Calculate capacity utilization
            utilization = slot_demand / available_capacity

            # Dynamic pricing
            if utilization < 0.7:
                price_modifier = 0.8  # 20% discount
                incentive = 'Discount - low demand'
            elif utilization < 0.9:
                price_modifier = 1.0  # Standard price
                incentive = 'Standard pricing'
            else:
                price_modifier = 1.5  # 50% surge
                incentive = 'Surge - high demand'

            pricing.append({
                'time_slot': slot,
                'demand': slot_demand,
                'capacity': available_capacity,
                'utilization': utilization,
                'price_modifier': price_modifier,
                'incentive': incentive
            })

        return pd.DataFrame(pricing)

時間枠の戦略:

  • 時間枠の幅に応じた段階的な料金設定
  • 需要/配送能力に応じた動的な料金設定
  • 対面配達と非対面配達の選択肢
  • 柔軟な対応を希望するお客様向けのロッカー/受け取り
  • 予測型の「スマート」時間枠(ML ベース)
3. マイクロフルフィルメントとダークストア

コンセプト:

  • 在庫をお客様の近くに配置します
  • ラストマイルの距離と配送時間を短縮します

ダークストア戦略:

class MicroFulfillmentOptimizer:
    """
    Optimize micro-fulfillment center locations

    Analyze trade-off between facility costs and delivery savings
    """

    def __init__(self, customer_locations, demand, current_hub):
        self.customers = np.array(customer_locations)
        self.demand = np.array(demand)
        self.current_hub = np.array(current_hub)

    def calculate_current_distances(self):
        """Calculate distances from current hub to customers"""

        distances = np.linalg.norm(
            self.customers - self.current_hub,
            axis=1
        )

        return distances

    def evaluate_micro_hub_location(self, micro_hub_location):
        """
        Evaluate benefit of adding micro-fulfillment center

        Returns distance savings and cost impact
        """

        current_distances = self.calculate_current_distances()

        # Distance to micro hub
        distances_to_micro = np.linalg.norm(
            self.customers - micro_hub_location,
            axis=1
        )

        # Assign customers to nearest hub
        use_micro_hub = distances_to_micro < current_distances

        # Calculate savings
        distance_savings = (
            current_distances[use_micro_hub].sum() -
            distances_to_micro[use_micro_hub].sum()
        )

        customers_served = use_micro_hub.sum()
        demand_served = self.demand[use_micro_hub].sum()

        return {
            'micro_hub_location': micro_hub_location,
            'customers_served': customers_served,
            'demand_served': demand_served,
            'distance_savings': distance_savings,
            'avg_distance_reduction': distance_savings / customers_served if customers_served > 0 else 0
        }

    def optimize_micro_hub_locations(self, num_micro_hubs=3):
        """
        Find optimal locations for micro-fulfillment centers

        Uses k-means clustering
        """

        from sklearn.cluster import KMeans

        # Weight locations by demand
        weighted_locations = np.repeat(
            self.customers,
            self.demand.astype(int),
            axis=0
        )

        # Find optimal cluster centers
        kmeans = KMeans(n_clusters=num_micro_hubs, random_state=42)
        kmeans.fit(weighted_locations)

        micro_hub_locations = kmeans.cluster_centers_

        # Evaluate each micro hub
        results = []
        for loc in micro_hub_locations:
            result = self.evaluate_micro_hub_location(loc)
            results.append(result)

        return results

    def calculate_micro_hub_roi(self, micro_hub_cost_annual,
                                demand_served, distance_savings,
                                cost_per_mile=2.50):
        """
        Calculate ROI for micro-fulfillment center

        Parameters:
        - micro_hub_cost_annual: Annual cost of micro hub
        - demand_served: Annual deliveries from micro hub
        - distance_savings: Total miles saved per delivery
        - cost_per_mile: Delivery cost per mile
        """

        # Annual savings from reduced distance
        annual_miles_saved = distance_savings * demand_served * 365
        annual_cost_savings = annual_miles_saved * cost_per_mile

        # Additional savings from faster delivery (premium pricing)
        faster_delivery_premium = demand_served * 365 * 2.00  # $2 premium per delivery

        total_annual_benefit = annual_cost_savings + faster_delivery_premium

        # ROI
        net_benefit = total_annual_benefit - micro_hub_cost_annual
        roi = net_benefit / micro_hub_cost_annual if micro_hub_cost_annual > 0 else 0
        payback_years = micro_hub_cost_annual / total_annual_benefit if total_annual_benefit > 0 else 999

        return {
            'annual_cost': micro_hub_cost_annual,
            'annual_benefit': total_annual_benefit,
            'net_benefit': net_benefit,
            'roi': roi,
            'payback_years': payback_years
        }

# Example: Should we open a micro-fulfillment center?
customer_locations = np.random.rand(500, 2) * 20
demand = np.random.poisson(2, 500)
current_hub = np.array([10, 10])

optimizer = MicroFulfillmentOptimizer(customer_locations, demand, current_hub)
micro_hub_results = optimizer.optimize_micro_hub_locations(num_micro_hubs=2)

for idx, result in enumerate(micro_hub_results):
    roi = optimizer.calculate_micro_hub_roi(
        micro_hub_cost_annual=250000,
        demand_served=result['demand_served'],
        distance_savings=result['avg_distance_reduction']
    )

    print(f"\nMicro Hub {idx + 1}:")
    print(f"  Location: {result['micro_hub_location']}")
    print(f"  Customers: {result['customers_served']}")
    print(f"  Annual ROI: {roi['roi']:.1%}")
    print(f"  Payback: {roi['payback_years']:.1f} years")

マイクロフルフィルメントのメリット:

  • 配送距離を短縮(30-60%)
  • 配送時間を短縮(当日配送が可能)
  • 配送1件あたりのコストを削減
  • 顧客満足度を向上
  • 超高速配送(1-2時間)を実現
4. 代替配送手段

A. クラウドソース/ギグ配送

class GigDeliveryOptimizer:
    """
    Optimize use of gig delivery drivers

    Balance dedicated fleet vs. on-demand gig workers
    """

    def __init__(self, base_volume, peak_volume, dedicated_fleet_size):
        self.base_volume = base_volume
        self.peak_volume = peak_volume
        self.dedicated_fleet_size = dedicated_fleet_size

    def calculate_cost_comparison(self):
        """
        Compare cost of dedicated fleet vs. gig workers

        Returns optimal mix
        """

        # Dedicated driver costs
        driver_annual_cost = 55000  # Salary + benefits
        deliveries_per_driver_per_day = 40
        dedicated_capacity = self.dedicated_fleet_size * deliveries_per_driver_per_day

        # Gig driver costs
        gig_cost_per_delivery = 8.50  # Variable cost

        # Calculate scenarios
        scenarios = []

        # Scenario 1: All dedicated
        dedicated_only_cost = (
            self.dedicated_fleet_size * driver_annual_cost +
            max(0, self.peak_volume - dedicated_capacity) * 250 * gig_cost_per_delivery
        )

        scenarios.append({
            'scenario': 'All Dedicated (sized for base)',
            'dedicated_drivers': self.dedicated_fleet_size,
            'annual_cost': dedicated_only_cost,
            'flexibility': 'Low'
        })

        # Scenario 2: Hybrid (dedicated for base, gig for peak)
        base_drivers = int(self.base_volume / deliveries_per_driver_per_day)
        peak_overflow = self.peak_volume - (base_drivers * deliveries_per_driver_per_day)
        peak_days_per_year = 100  # Assume 100 peak days

        hybrid_cost = (
            base_drivers * driver_annual_cost +
            peak_overflow * peak_days_per_year * gig_cost_per_delivery
        )

        scenarios.append({
            'scenario': 'Hybrid (dedicated base + gig peak)',
            'dedicated_drivers': base_drivers,
            'annual_cost': hybrid_cost,
            'flexibility': 'High'
        })

        # Scenario 3: Mostly gig
        minimal_dedicated = max(1, int(base_drivers * 0.3))
        gig_volume = (
            self.base_volume * 250 +  # Base days
            self.peak_volume * 100    # Peak days
        ) - (minimal_dedicated * deliveries_per_driver_per_day * 350)

        mostly_gig_cost = (
            minimal_dedicated * driver_annual_cost +
            gig_volume * gig_cost_per_delivery
        )

        scenarios.append({
            'scenario': 'Mostly Gig (minimal dedicated)',
            'dedicated_drivers': minimal_dedicated,
            'annual_cost': mostly_gig_cost,
            'flexibility': 'Very High'
        })

        return sorted(scenarios, key=lambda x: x['annual_cost'])

# Example
optimizer = GigDeliveryOptimizer(
    base_volume=1200,  # Base daily deliveries
    peak_volume=2000,  # Peak daily deliveries
    dedicated_fleet_size=35
)

scenarios = optimizer.calculate_cost_comparison()
for s in scenarios:
    print(f"{s['scenario']}: ${s['annual_cost']:,.0f}")

B. 自律走行配送ロボット

def evaluate_robot_delivery(delivery_volume, avg_delivery_distance,
                           robot_cost=5000, robot_capacity=20):
    """
    Evaluate feasibility of autonomous delivery robots

    For short-distance, high-density urban areas
    """

    # Robot economics
    robot_deliveries_per_day = 10  # Limited by speed and recharging
    robot_lifespan_years = 5
    robot_annual_cost = robot_cost / robot_lifespan_years + 500  # Maintenance

    # Human delivery cost (benchmark)
    human_cost_per_delivery = 7.50

    # Robots only viable for short distances
    if avg_delivery_distance > 2.0:  # miles
        return {
            'viable': False,
            'reason': 'Distance too far for robots',
            'recommendation': 'Use traditional delivery'
        }

    # Calculate breakeven
    robots_needed = delivery_volume / robot_deliveries_per_day
    robot_total_cost = robots_needed * robot_annual_cost
    robot_cost_per_delivery = robot_total_cost / (delivery_volume * 365)

    savings = human_cost_per_delivery - robot_cost_per_delivery
    annual_savings = savings * delivery_volume * 365

    return {
        'viable': robot_cost_per_delivery < human_cost_per_delivery,
        'robots_needed': int(np.ceil(robots_needed)),
        'robot_cost_per_delivery': robot_cost_per_delivery,
        'human_cost_per_delivery': human_cost_per_delivery,
        'annual_savings': annual_savings,
        'payback_years': (robots_needed * robot_cost) / annual_savings if annual_savings > 0 else 999
    }

C. ロッカーと受け取り拠点

class LockerNetworkOptimizer:
    """
    Optimize parcel locker network

    Reduce failed deliveries and cost for flexible customers
    """

    def __init__(self, customer_locations, customer_flexibility):
        """
        Parameters:
        - customer_locations: (x, y) coordinates
        - customer_flexibility: 0-1, willingness to use locker
        """
        self.customers = np.array(customer_locations)
        self.flexibility = np.array(customer_flexibility)

    def optimize_locker_locations(self, num_lockers=10,
                                  max_distance=1.0):
        """
        Find optimal locker locations

        Parameters:
        - num_lockers: Number of lockers to place
        - max_distance: Max distance customers will travel (miles)
        """

        from sklearn.cluster import KMeans

        # Weight by flexibility (prioritize flexible customers)
        weighted_customers = self.customers[self.flexibility > 0.5]

        if len(weighted_customers) < num_lockers:
            return {'error': 'Not enough flexible customers'}

        # Cluster to find locker locations
        kmeans = KMeans(n_clusters=num_lockers, random_state=42)
        kmeans.fit(weighted_customers)

        locker_locations = kmeans.cluster_centers_

        # Analyze coverage
        coverage = []
        for locker_loc in locker_locations:
            distances = np.linalg.norm(
                self.customers - locker_loc,
                axis=1
            )

            # Customers within max distance and flexible
            within_range = distances <= max_distance
            flexible_enough = self.flexibility > 0.5
            covered = within_range & flexible_enough

            coverage.append({
                'location': locker_loc,
                'customers_covered': covered.sum(),
                'deliveries_diverted': covered.sum()  # Assume 1 delivery per customer
            })

        return coverage

    def calculate_locker_roi(self, locker_cost_annual,
                            deliveries_diverted,
                            home_delivery_cost=8.50,
                            locker_delivery_cost=2.50):
        """
        Calculate ROI for locker network

        Lockers consolidate deliveries, reducing cost
        """

        # Cost savings per delivery
        savings_per_delivery = home_delivery_cost - locker_delivery_cost

        # Annual savings
        annual_savings = deliveries_diverted * 365 * savings_per_delivery

        # ROI
        net_benefit = annual_savings - locker_cost_annual
        roi = net_benefit / locker_cost_annual if locker_cost_annual > 0 else 0

        return {
            'annual_cost': locker_cost_annual,
            'annual_savings': annual_savings,
            'net_benefit': net_benefit,
            'roi': roi
        }

テクノロジーソリューション

ラストマイル配送プラットフォーム

ルート最適化:

  • OptimoRoute:動的なルート設定とスケジュール管理
  • Onfleet:配送管理と追跡
  • Bringg:配送オーケストレーションプラットフォーム
  • Routific:複数地点を巡るルートの最適化
  • Circuit:チーム向けのルート最適化
  • WorkWave:ルート計画とモバイル対応

配送管理:

  • Bringg:複数の車両群のオーケストレーション
  • FarEye:配送実行プラットフォーム
  • Shipday:地域配送管理
  • Track-POD:配達証明アプリ
  • Tookan:ギグ配送管理

顧客体験:

  • Narvar:購入後の追跡
  • AfterShip:荷物の追跡
  • Malomo:ブランド化された追跡体験
  • Route:荷物追跡アプリ(消費者向け)
API と統合
# Example: Integration with route optimization API

import requests
import json

def optimize_routes_api(stops, depot, api_key):
    """
    Call route optimization API

    Example using generic API structure
    """

    url = "https://api.routeoptimizer.com/v1/optimize"

    payload = {
        "depot": {
            "lat": depot['lat'],
            "lon": depot['lon']
        },
        "stops": [
            {
                "id": stop['id'],
                "lat": stop['lat'],
                "lon": stop['lon'],
                "demand": stop['demand'],
                "time_window": stop['time_window'],
                "service_time": stop['service_time']
            }
            for stop in stops
        ],
        "vehicles": {
            "count": 5,
            "capacity": 100,
            "start_time": "08:00",
            "end_time": "18:00"
        }
    }

    headers = {
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    if response.status_code == 200:
        result = response.json()
        return result['routes']
    else:
        return {'error': response.text}

よくある課題と解決策

課題:配送の失敗

問題:

  • 顧客が不在
  • アクセス上の問題(ゲート、施錠された建物)
  • 住所の誤り
  • 配送失敗率が10~20%

解決策:

  • 到着予定時刻の通知を伴うリアルタイム追跡
  • 到着前のSMS通知
  • 置き配オプション(安全な場所、ガレージ)
  • ロッカー/受取拠点のネットワーク
  • 配達証明写真
  • 顧客との双方向コミュニケーション
  • 予測型の「スマート」時間帯
  • 配送指示欄
課題:都市部の駐車とアクセス

問題:

  • 配送先に駐車スペースがない
  • 混雑と交通渋滞
  • アクセス制限
  • 二重駐車の違反切符

解決策:

  • 小型車両(カーゴバイク、スクーター)
  • 高密度エリアでの徒歩ルート
  • オフピーク時間帯の配送
  • 荷さばきスペースの許可証
  • デジタル路肩管理システム
  • 建物のコンシェルジュ/メールルームへの配送
  • 駐車場アプリ(SpotHero)との提携
課題:コストとスピードのトレードオフ

問題:

  • 顧客は迅速な配送を求めている
  • 迅速な配送には費用がかかる
  • 利益率への圧力

解決策:

  • 段階的な配送オプション(エコノミー/標準/エクスプレス)
  • 需要に応じた動的な価格設定
  • 当日配送の割増料金
  • 送料無料となる最低注文金額
  • サブスクリプションプログラム(配送パス)
  • 配送時間帯(正確な時刻ではなく)
  • 注文の集約(数時間遅らせてまとめて配送)
課題:返品とリバースロジスティクス

問題:

  • 返品率が高い(eコマース)
  • リバースロジスティクスが複雑
  • 収益性の低下

解決策:

  • 集荷スケジュール管理システム
  • 返品用ロッカーへの持ち込み
  • 小売店との提携(返品拠点)
  • 返品集荷の集約
  • 顧客の持ち込みを促進(クレジット付与)
  • フィット感/サイズ選びツールの改善(返品を削減)
課題:配送密度のばらつき

問題:

  • 高密度なエリアもあれば、まばらなエリアもある
  • ゾーンごとに採算性が一定しない

解決策:

  • ゾーンごとの最低注文金額
  • 配送密度に応じた配送料
  • 低密度エリアでは配送時間帯を長くする
  • 週ごとの配送日を設定(毎日ではなく)
  • 低密度ゾーンではロッカー/受取拠点を利用
  • 他の配送業者と提携(ルートを共有)
  • 高密度ゾーンを中心にマーケティング

出力形式

ラストマイル配送分析レポート

エグゼクティブサマリー:

  • 1日の配送量:1,850個
  • 現在の配送1件あたりのコスト:$9.20
  • 時間どおりの配送率:91%
  • 配送失敗率:12%
  • 配送1件あたりの目標コスト:$7.50(18%削減)

現在のパフォーマンス:

指標現在業界ベンチマーク差
配送1件あたりのコスト$9.20$7.50⚠️ 23%高い
1時間あたりの配達先数6.28.0⚠️ 23%低い
初回配達成功率88%92%⚠️ 4%低い
配送密度22/sq mi35/sq mi⚠️ 37%低い
ルート効率78%85%⚠️ 7%低い

コスト内訳:

項目配送1件あたりのコスト合計に占める割合
ドライバー人件費$4.2046%
車両(燃料、メンテナンス)$2.5027%
ハブ/間接費$1.8020%
配送失敗$0.708%
合計$9.20100%

最適化の機会:

  1. 配送密度を高める(+15%)

    • サービスが行き届いていないクラスターにマーケティングを集中する
    • マイクロフルフィルメントハブを2か所追加する
    • 効果:配送1件あたり-$1.20
  2. 配送失敗を減らす(12% → 6%)

    • 顧客通知を導入する
    • 宅配ロッカーを25台追加する
    • 効果:配送1件あたり-$0.35
  3. 時間帯指定を最適化する

    • 需要に応じたダイナミックプライシング
    • 柔軟に対応できる顧客には時間帯の幅を広げる
    • 効果:配送1件あたり-$0.50
  4. ルート最適化ソフトウェア

    • AI を活用したルート設定を導入する
    • 1時間あたりの配達先数を増やす(6.2 → 8.0)
    • 効果:配送1件あたり-$0.65

導入計画:

施策期間投資額年間削減額投資回収期間
ルート最適化ソフトウェアQ1$50K$420K1.4か月
宅配ロッカーネットワークQ2-Q3$180K$225K9.6か月
マイクロフルフィルメントハブ2か所Q4$500K$650K9.2か月
顧客通知システムQ1$25K$150K2.0か月

期待される成果(1年目):

指標現在1年目の目標改善
配送1件あたりのコスト$9.20$7.50-18%
1時間あたりの配達先数6.28.0+29%
配送失敗率12%6%-50%
時間どおりの配送率91%96%+5ポイント
顧客満足度4.1/54.5/5+0.4

質問事項

さらに詳しい情報が必要な場合:

  1. 1日の配送量はどれくらいですか?
  2. 現在の配送1件あたりのコストはいくらですか?
  3. サービスエリアはどのような地域ですか?(都市部、郊外、農村部)
  4. 配送時間の約束はどのようなものですか?
  5. 配送失敗率はどれくらいですか?
  6. フルフィルメント拠点は複数ありますか?
  7. 自社車両を保有していますか、それともギグワーカーを利用していますか?
  8. どのようなテクノロジーシステムを導入していますか?
  9. この分析の目的は何ですか?(コスト、サービス、成長)

関連スキル

  • route-optimization:日々の配送ルートを最適化します
  • fleet-management:車両フリートの規模設定と管理を行います
  • freight-optimization:長距離輸送からハブまでの輸送を最適化します
  • ecommerce-fulfillment:Eコマースのフルフィルメント戦略を策定します
  • omnichannel-fulfillment:マルチチャネルのフルフィルメントを実施します
  • warehouse-design:マイクロフルフィルメントセンターを設計します
  • network-design:フルフィルメントネットワーク戦略を策定します
  • customer-service:配送体験を最適化します
  • supply-chain-analytics:配送パフォーマンス指標を分析します

コメント