# Sweep Route Construction Calculator AI Agent Connect

> Sweep Route Construction Calculator organizes delivery stops into logical vehicle routes using a sweep algorithm. It clusters stops based on their polar angles relative to your depot and ensures each route stays within your specific vehicle capacity, time windows, and maximum duration limits.

## Overview
- **Category:** logistics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_oH0Huu0vVPXU0WCJG4cDHrnWUAF39RJlftE3cNA6/ai-agent-connect
- **Tags:** routing, logistics, sweep-algorithm, vehicle-routing, optimization

## Description

You can use this MCP to handle the heavy lifting of route planning. Instead of manually grouping stops, you let your AI client use the sweep algorithm to cluster delivery locations based on their angular position around a central depot. This method creates organized, circular-style routes that make sense geographically. 

Once the stops are clustered, the engine builds full plans that respect your real-world operational limits. It won't suggest a route that exceeds your vehicle's capacity or runs past a customer's time window. You can check the math on any specific route to ensure it meets your requirements, or pull a high-level summary to see how well your fleet is being utilized. It's a specialized engine designed to turn a list of coordinates into a workable logistics plan.

## Tools

### calculate_sweep_order
This tool determines the sequence of stops by calculating their angular position around your depot.

### generate_routes
Use this to group your sorted stops into valid, actionable vehicle routes.

### get_route_summary
This tool provides a high-level overview of how efficient and well-covered your routing plan is.

### validate_route_constraints
This tool checks a completed route against your specific operational requirements to ensure compliance.

## Prompt Examples

**Prompt:** 
```
Calculate the sweep order for these stops around the depot at { latitude: 40.7128, longitude: -74.0060 }.
```

**Response:** 
```
{"sortedStopIds": ["stop_1", "stop_2", "stop_3"]}
```

**Prompt:** 
```
Generate routes for these sorted stop IDs with a vehicle capacity of 50 and max duration of 300.
```

**Response:** 
```
{"routes": [{"vehicleId": "v1", "stopSequence": ["stop_1", "stop_2"], "totalLoad": 30, "totalDuration": 120}], "rejectedStopIds": []}
```

**Prompt:** 
```
Get a summary of the routing plan for 10 total stops.
```

**Response:** 
```
{"routeCount": 2, "totalLoad": 85, "utilizationRate": 0.8, "rejectionRate": 0.1}
```

## Capabilities

### Angular Clustering
Your agent uses polar coordinates to group stops into logical sectors.

### Constraint Enforcement
Your agent checks routes against vehicle capacity and time windows.

### Route Validation
Your agent verifies that completed routes meet all operational rules.

### Efficiency Reporting
Your agent pulls summaries to check fleet utilization and coverage.

## Use Cases

### Last-Mile Delivery
Organize a set of residential stops into routes that fit within a single van's capacity.

### Fleet Optimization
Check if your current routing plan maximizes vehicle utilization and minimizes empty miles.

### Constraint Checking
Verify that a proposed route won't violate a customer's specific time window.

### Depot-Based Routing
Group delivery points into sectors based on their position relative to your warehouse.

## Benefits

- Clusters stops using polar angles to create geographically logical routes.
- Enforces vehicle capacity and time window constraints automatically.
- Provides high-level efficiency metrics for the entire routing plan.
- Validates individual routes to ensure they meet operational requirements.

## How It Works

You connect the MCP to your AI client and provide your stop data and constraints.

1. Connect your AI client to the Vinkius-hosted MCP.
2. Provide the depot location and stop coordinates.
3. Run the sweep algorithm to determine the angular order of stops.
4. Generate the final routes based on your vehicle capacity and time limits.
5. Validate the routes to ensure they meet all operational constraints.

## Frequently Asked Questions

**How does the sweep algorithm work?**
It clusters stops by their polar angles relative to a central depot, creating organized sectors for vehicles to follow.

**Can I set vehicle capacity limits?**
Yes, you can specify vehicle capacity and maximum route duration when generating routes.

**What AI clients can use this MCP?**
You can use this MCP with any compatible client like Claude, Cursor, or Windsurf.

**Does it handle time windows?**
Yes, the engine ensures routes adhere to customer time windows and maximum route durations.

**How do I know if a route is valid?**
You can use the validate_route_constraints tool to check if a specific route meets all your operational requirements.

**Can I verify if a specific route is valid?**
Yes, you can use the `validate_route_constraints` tool to check if a sequence of stops respects capacity, time windows, and duration limits.

**What happens if a stop cannot be serviced?**
Stops that violate capacity, duration, or time window constraints are identified as rejected stops during the `generate_routes` process.
