CodeComplex: Benchmarking Java Code Complexity

CodeComplex: Benchmarking Java Code Complexity

TL;DR

CodeComplex is a Java code-complexity dataset built from real CodeForces submissions. Its overview reports 4,200 expert-labeled solutions, while the contents section lists 4,517 Java source files.

Each labeled solution is assigned to one of seven complexity categories through manual expert annotation and independent cross-verification. The dataset supports research on predicting algorithmic complexity from source code, benchmarking code-intelligence models, and automated program analysis.

What CodeComplex Is

CodeComplex, now available on AIOZ AI, is designed for training and evaluating models that predict the complexity of Java programs.

It uses complete competitive-programming submissions from CodeForces, giving researchers access to real implementations with the control flow, data structures, and algorithmic variation found in contest solutions.

How the Dataset Is Organized

CodeComplex includes:

  • Java source files: 4,517 submissions listed in the dataset contents
  • Complexity labels: Seven expert-assigned categories
  • Problem names: The original contest problem linked to each solution
  • Source metadata: Information describing where each submission comes from

The seven categories are: Constant, Linear, Quadratic, Cubic, log(n), n log(n), and NP-hard.

What It Measures

CodeComplex evaluates whether a model can infer an expert-assigned complexity category directly from Java source code.

Research uses include:

  • Code-complexity prediction
  • Supervised learning for algorithmic performance estimation
  • Code-intelligence benchmarking
  • Automated program analysis
  • Code-review and optimization research
  • Transfer learning across algorithm categories

The task goes beyond surface syntax. Models need to connect loops, recursion, data structures, control flow, and algorithm design with the assigned complexity class.

Key Dataset Details

  • Dataset: CodeComplex
  • Primary task: Code-complexity classification
  • Programming language: Java
  • Source: CodeForces submissions
  • Labeled solutions reported: 4,200
  • Java source files listed: 4,517
  • Complexity categories: 7
  • Annotation process: Manual expert labeling with independent cross-verification
  • Additional metadata: Problem names and source-origin information
  • Dataset license: Apache License 2.0
  • Non-code materials license: Creative Commons Attribution 4.0 International

What Builders Should Know

CodeComplex focuses on Java competitive-programming solutions, so benchmark results should be interpreted within that domain rather than as a general measure of complexity prediction across all languages or software systems.

Its labels describe algorithmic complexity categories, not direct runtime. Actual execution time can still vary with hardware, compiler behavior, input distribution, and implementation details.

Access It on AIOZ AI

With real Java contest solutions and expert-verified complexity labels, CodeComplex provides a focused benchmark for models that reason about algorithmic behavior from source code.

Access CodeComplex on AIOZ AI and start evaluating code-complexity prediction.

FAQ

Q1: What is CodeComplex used for?

It is used to train and evaluate models that predict expert-assigned complexity categories from Java source code.

Q2: How large is the CodeComplex dataset?

It includes 4,200 labeled solutions and separately lists 4,517 Java source files.

Q3: What complexity categories does CodeComplex include?

It includes seven categories: constant, linear, quadratic, cubic, log(n), n log(n), and NP-hard.