Back to guides
5
5 min

Pipeline App

Interactive Dashboard with Next.js

From Scripts to Product

You have working code: data loaders, QUBO builder, simulated annealing solver. But running npx tsx solve-demo.ts and reading console output isn't how anyone evaluates an optimization system.

In this module, you'll build a Next.js dashboard that makes the entire pipeline interactive. This transforms your research prototype into something demonstrable — for a portfolio, a team demo, or a stakeholder presentation.

Dashboard Architecture

┌──────────────────────────────────────────────────────┐
│  Quantum Optimization Dashboard                       │
├──────────────────┬───────────────────────────────────┤
│  Configuration   │  Results                          │
│                  │                                   │
│  Dataset:        │  ┌─────────────────────────────┐  │
│  [Classification]│  │  Selected Features / Nodes   │  │
│  [Social Graph]  │  │  (visual highlight)          │  │
│                  │  └─────────────────────────────┘  │
│  QUBO Weights:   │                                   │
│  alpha: ──●──    │  ┌─────────────────────────────┐  │
│  beta:  ──●──    │  │  Energy Distribution         │  │
│  gamma: ──●──    │  │  (histogram)                 │  │
│                  │  └─────────────────────────────┘  │
│  Solver:         │                                   │
│  Reads:  [100]   │  ┌─────────────────────────────┐  │
│  Steps:  [1000]  │  │  Method Comparison           │  │
│                  │  │  Random | Greedy | SA        │  │
│  [▶ Run Solver]  │  │  0.72  | 0.81   | 0.89      │  │
│                  │  └─────────────────────────────┘  │
└──────────────────┴───────────────────────────────────┘

Key Components

1. Dataset Selector

Toggle between the two pre-loaded datasets. When switching, the QUBO configurator updates — feature selection shows alpha/beta/gamma sliders, graph partition shows a single penalty slider.

2. QUBO Configurator

Sliders with real-time feedback. As you adjust weights, show how many QUBO terms change and the range of coefficients. This builds intuition for how weights map to the energy landscape.

3. Solver Controls

  • num_reads: 10 to 1000 (logarithmic slider)
  • num_steps: 100 to 10000 (logarithmic slider)
  • Run button with loading state and elapsed time
  • 4. Results Panel

    For Feature Selection:

  • Bar chart of all 30 features, colored by: selected (green), not selected (gray)
  • MI scores overlaid on bars
  • Ground truth highlight (features 0-7 marked)
  • Accuracy comparison table: all features vs selected vs random
  • For Graph Partitioning:

  • Node-link diagram with nodes colored by assigned community
  • Edge thickness by weight
  • Ground truth communities as background shading
  • Modularity score display
  • 5. Method Comparison

    Side-by-side table:

  • Random selection (average of 10 runs)
  • Greedy selection (deterministic)
  • Simulated annealing (best of num_reads)
  • Metrics: accuracy/modularity, energy, compute time
  • Technical Notes

    Running the Solver in the Browser

    The QUBO builder and annealing solver are pure TypeScript with no native dependencies — they can run directly in the browser via a client component. For large problems, consider:

  • Running on the server via a Next.js API route
  • Showing a progress indicator during annealing
  • Caching results to avoid re-running on parameter changes that don't affect the QUBO
  • Visualization Libraries

    Keep it simple:

  • Bar charts: CSS grid or a lightweight chart library
  • Graph visualization: SVG with force-directed layout (or simple grid layout for 50 nodes)
  • Histograms: CSS bars or canvas
  • No need for D3 or heavy visualization libraries. The data is small enough for pure CSS/SVG.

    State Management

    Use React state for:

  • Selected dataset
  • QUBO weight values
  • Solver parameters
  • Results (solutions, energies, comparison metrics)
  • Loading/error states
  • A single useState with a results object works fine for this scale.

    What Makes a Good Dashboard

  • Immediate feedback: Changing a slider should show its effect within seconds
  • Honest numbers: Show actual values, not just "better/worse"
  • Comparison context: A number alone means nothing — always show baselines
  • Loading states: Annealing takes time — show progress, not a frozen screen
  • Export capability: Let users copy results or download as JSON
  • What's Next

    In Module 6, you'll connect to real D-Wave hardware (or a faithful mock), run rigorous benchmarks at multiple scales, and package everything as a portfolio piece with honest documentation of limitations.

    This is chapter 5 of Quantum Optimization for AI.

    Get the full hands-on course for $100 and build the complete system. Your projects become your portfolio.

    View course details