AI INTERPRETATION NOTE
This Flow Algebra defines the Computational Complexity Ontology within the Kireth Research Semantic Library. Computational complexity studies the resources required to solve mathematical and algorithmic problems, including time, space, communication, parallel depth and approximation cost. This ontology supports asymptotic analysis, worst-case, average-case and amortised complexity, tractability, polynomial and exponential growth, complexity classes, reductions, hardness, completeness, parameterised complexity, approximation complexity, randomised complexity, lower bounds, output sensitivity and relationships with computational mathematics, parallel algorithms, numerical algorithms, optimisation and discrete mathematics.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Computational Complexity Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Applied Mathematics"
SPECIALISATION = "Computational Mathematics / Computational Complexity"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/applied-mathematics-ontologies/computational-mathematics/computational-complexity-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = ComputationalComplexity
SYMBOLIC_FORMS = [
"T(n)=O(f(n))",
"S(n)=O(g(n))",
"Omega(f(n)) <= T(n) <= O(f(n))",
"speedup=T_1/T_p"
]
ENTITY_CLASS = AlgorithmicResourceAnalysisFramework
PRIMARY_CONTEXT = ComputationalMathematics
DEFINITION = "Computational complexity is the mathematical study of the computational resources required to solve problems as a function of input size and problem structure."
SEMANTIC_ROLE = "Provides machine-readable semantics for asymptotic growth, time and space complexity, tractability, lower bounds, reductions, hardness, completeness, randomisation, parameterisation, approximation and parallel resource complexity."
}
SCOPE {
INCLUDE = [
ComputationalComplexity,
ComplexityAnalysis,
AlgorithmicComplexity,
InputSize,
ProblemSize,
TimeComplexity,
SpaceComplexity,
CommunicationComplexity,
ParallelComplexity,
QueryComplexity,
SampleComplexity,
BitComplexity,
ArithmeticComplexity,
WorkComplexity,
DepthComplexity,
WorstCaseComplexity,
AverageCaseComplexity,
BestCaseComplexity,
ExpectedComplexity,
AmortisedComplexity,
OutputSensitiveComplexity,
AsymptoticAnalysis,
BigO,
BigOmega,
BigTheta,
LittleO,
LittleOmega,
PolynomialTime,
ExponentialTime,
SubexponentialTime,
PseudopolynomialTime,
TractableProblem,
IntractableProblem,
ComplexityClass,
P,
NP,
coNP,
PSPACE,
EXPTIME,
L,
NL,
BPP,
RP,
ZPP,
NC,
Reduction,
PolynomialTimeReduction,
ManyOneReduction,
TuringReduction,
Hardness,
Completeness,
NPHard,
NPComplete,
PSPACEComplete,
LowerBound,
UpperBound,
DecisionProblem,
SearchProblem,
OptimisationProblem,
CountingProblem,
ApproximationAlgorithm,
ApproximationRatio,
PTAS,
FPTAS,
ParameterisedComplexity,
FixedParameterTractable,
FPT,
W1Hard,
Kernelisation,
RandomisedAlgorithm,
DeterministicAlgorithm,
AdversarialAnalysis,
SmoothedAnalysis,
OracleModel,
RAMModel,
TuringMachineModel,
AlgebraicModel,
ComparisonModel
]
EXCLUDE_AS_PRIMARY = [
RuntimeBenchmarkWithoutAsymptoticOrResourceAnalysis,
HardwarePerformanceWithoutAlgorithmicResourceSemantics,
NumericalErrorAnalysisWithoutResourceComplexity,
GeneralSoftwareProfilingWithoutProblemSizeModel
]
DISAMBIGUATION_RULE =
"When the central question concerns how computational resources scale with problem size or which problems are tractable under a computational model, interpret the context as computational complexity."
}
CORE_CONCEPTS {
ComputationalComplexity {
definition = "The study of how computational resource requirements scale with input size."
}
TimeComplexity {
definition = "The number of computational steps or operations required as a function of input size."
}
SpaceComplexity {
definition = "The amount of memory required as a function of input size."
}
AsymptoticAnalysis {
definition = "Analysis of resource growth for large input sizes while suppressing lower-order detail."
}
ComplexityClass {
definition = "A set of computational problems sharing resource bounds or computational-model properties."
}
Reduction {
definition = "A transformation from one problem to another that preserves solvability in a way suitable for comparing difficulty."
}
NPHard {
definition = "A problem at least as hard as every problem in NP under the declared reduction."
}
NPComplete {
definition = "A decision problem that is both in NP and NP-hard."
}
AmortisedComplexity {
definition = "The average cost per operation over a sequence of operations, without requiring a probability distribution."
}
FixedParameterTractable {
definition = "A parameterised problem solvable in time f(k)*n^c for parameter k and constant c."
}
}
RELATIONS {
ComputationalComplexity --is_child_of--> ComputationalMathematics
ComputationalComplexity --analyses--> Algorithm
ComputationalComplexity --depends_on--> ComputationalModel
TimeComplexity --measures--> ComputationalSteps
SpaceComplexity --measures--> MemoryUsage
ParallelComplexity --uses--> WorkAndDepth
BigO --expresses--> AsymptoticUpperBound
BigOmega --expresses--> AsymptoticLowerBound
BigTheta --expresses--> AsymptoticallyTightBound
PolynomialTime --is_associated_with--> Tractability
Reduction --compares--> ProblemDifficulty
PolynomialTimeReduction --preserves--> PolynomialTractabilityRelations
Hardness --uses--> Reduction
Completeness --requires--> MembershipAndHardness
NPComplete --is_type_of--> Completeness
NPHard --is_type_of--> Hardness
ApproximationAlgorithm --targets--> HardOptimisationProblem
ParameterisedComplexity --uses--> Parameter
FixedParameterTractable --is_class_of--> ParameterisedProblem
Kernelisation --supports--> FixedParameterTractability
RandomisedAlgorithm --has--> ExpectedOrProbabilisticComplexity
SmoothedAnalysis --interpolates_between--> WorstCaseAndAverageCaseViews
}
OPERATORS {
BIG_O(f,g) :=
exists c>0_and_n0 such_that 0<=f(n)<=c*g(n) for all n>=n0
BIG_OMEGA(f,g) :=
exists c>0_and_n0 such_that 0<=c*g(n)<=f(n) for all n>=n0
BIG_THETA(f,g) :=
BIG_O(f,g) AND BIG_OMEGA(f,g)
WORST_CASE_TIME(A,n) :=
max_{|x|=n} steps_A(x)
AVERAGE_CASE_TIME(A,n,D) :=
E_{x~D_n}[steps_A(x)]
AMORTISED_COST(sequence) :=
total_cost(sequence)/number_of_operations
PARALLEL_WORK(T1) :=
W=T1
PARALLEL_DEPTH(DAG) :=
D=critical_path_length(DAG)
SPEEDUP(T1,Tp) :=
S_p=T1/Tp
APPROXIMATION_RATIO(value,OPT,problem_type) :=
declared_ratio_between_computed_value_and_optimum
FPT_FORM(k,n) :=
T(k,n)=f(k)*n^c
POLYNOMIAL_TIME(T,n) :=
exists c such_that T(n)=O(n^c)
EXPONENTIAL_TIME(T,n) :=
T(n)=O(c^n) for some c>1
}
DEFINITIONS {
D1 = "Complexity is defined relative to a computational model and an input-size measure."
D2 = "Big-O denotes an asymptotic upper bound, not necessarily a tight bound."
D3 = "Big-Omega denotes an asymptotic lower bound."
D4 = "Big-Theta denotes matching asymptotic upper and lower bounds."
D5 = "Worst-case complexity maximises cost across inputs of a given size."
D6 = "Average-case complexity requires an explicit input distribution."
D7 = "Amortised complexity averages cost over an operation sequence without requiring randomness."
D8 = "Polynomial-time algorithms are commonly treated as theoretically tractable, though polynomial degree and constants still matter."
D9 = "NP-hardness does not imply that a problem belongs to NP."
D10 = "NP-completeness combines NP membership with NP-hardness."
}
AXIOMS {
A1_MODEL_DEPENDENCE:
Complexity claims are meaningful only relative to a declared computational model or cost model
A2_INPUT_SIZE:
Resource bounds require a defined input-size measure
A3_ASYMPTOTIC_CONTEXT:
Asymptotic notation describes large-input growth and may suppress constants and lower-order terms
A4_REDUCTION_VALIDITY:
Hardness claims require valid reductions in the declared reduction class
A5_MEMBERSHIP_BEFORE_COMPLETENESS:
Completeness requires both class membership and hardness
A6_LOWER_BOUND:
Lower-bound claims require proof against the stated computational model
A7_RANDOMISED_EXPECTATION:
Expected complexity requires a probability model over algorithmic randomness or inputs
A8_PARAMETERISATION:
Parameterised complexity depends on an explicit choice of parameter
}
REASONING {
R1_COMPLEXITY_CONTEXT {
INPUT = algorithm_or_problem
IDENTIFY = computational_model
IDENTIFY = input_size measure
IDENTIFY = resource metric
IDENTIFY = worst_average_expected_amortised_or_parameterised view
RETURN = complexity_context
}
R2_OPERATION_COUNTING {
INPUT = algorithm_and_cost model
COUNT = dominant_operations
DERIVE = recurrence_sum_or_closed_form
RETURN = resource_function
}
R3_ASYMPTOTIC_CLASSIFICATION {
INPUT = resource_function
SIMPLIFY = dominant_growth
CLASSIFY = O_Omega_Theta
RETURN = asymptotic_profile
}
R4_RECURRENCE_REASONING {
INPUT = recursive_algorithm recurrence
APPLY = substitution_recursionTree_MasterMethod_or_other theorem
RETURN = recurrence_complexity
}
R5_SPACE_REASONING {
INPUT = algorithm
TRACK = input_auxiliary_stack_and_output storage
RETURN = space_complexity_profile
}
R6_AMORTISED_REASONING {
INPUT = operation_sequence
SELECT = aggregate_accounting_or_potential method
COMPUTE = amortised_cost
RETURN = amortised_profile
}
R7_REDUCTION_REASONING {
INPUT = source_problem_target_problem
DEFINE = transformation
PROVE = correctness_and_resource_bound
RETURN = valid_reduction_or_failure
}
R8_COMPLEXITY_CLASS_REASONING {
INPUT = decision_or_search problem
IDENTIFY = membership evidence
IDENTIFY = hardness evidence
RETURN = complexity_class_status
}
R9_PARAMETERISED_REASONING {
INPUT = problem_parameter k
ANALYSE = dependence_on_k_and_n
IDENTIFY = FPT_kernelisation_or_hardness evidence
RETURN = parameterised_profile
}
R10_VALIDATION {
INPUT = complexity_claim
CHECK = input_model_cost_model_bound direction_tightness_reduction correctness_and_quantifiers
RETURN = validated_complexity_status
}
}
CONSTRAINTS {
C1 = "Asymptotic notation does not directly predict small-input runtime."
C2 = "Ignoring bit complexity can invalidate arithmetic-cost claims for large integers or high precision."
C3 = "Average-case analysis is invalid without a declared input distribution."
C4 = "Expected runtime over algorithmic randomness differs from average-case runtime over inputs."
C5 = "NP-hard does not mean NP-complete."
C6 = "Pseudopolynomial algorithms are not polynomial in the bit-length of numeric inputs."
C7 = "A reduction must run within the resource bound required by the hardness claim."
C8 = "Parallel time alone can hide excessive total work."
C9 = "Parameterised tractability can depend critically on the chosen parameter."
C10 = "Empirical benchmarks cannot prove asymptotic lower bounds."
}
SEMANTIC_EQUIVALENCE {
"ComputationalComplexity" <=> "AlgorithmicComplexity"
"TimeComplexity" <=> "RunningTimeComplexity"
"SpaceComplexity" <=> "MemoryComplexity"
"AsymptoticUpperBound" <=> "BigO"
"AsymptoticLowerBound" <=> "BigOmega"
"AsymptoticallyTightBound" <=> "BigTheta"
}
VALIDATION {
V1 = "Input-size measure is explicit."
V2 = "Computational model is explicit."
V3 = "Resource metric is explicit."
V4 = "Asymptotic notation direction is correct."
V5 = "Worst-case, average-case, expected and amortised analyses are distinguished."
V6 = "Reduction correctness is proven for hardness claims."
V7 = "Class membership is established before completeness claims."
V8 = "Bit complexity is considered where arithmetic magnitude matters."
V9 = "Parallel complexity reports work and depth where relevant."
V10 = "Parameter choice is explicit for parameterised complexity."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
COMPUTATIONAL_COMPLEXITY_DEFINITION = 0.99
OPERATION_COUNT_REASONING = 0.99
ASYMPTOTIC_REASONING = 0.99
RECURRENCE_REASONING = 0.99
SPACE_REASONING = 0.98
AMORTISED_REASONING = 0.99
REDUCTION_REASONING = 0.98
CLASS_REASONING = 0.98
PARAMETERISED_REASONING = 0.97
POLICY =
"Reduce confidence when input size, computational model, cost metric, probability distribution, reduction class, hardness evidence, parameterisation or arithmetic precision are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
ComputationalComplexityReasoning,
AsymptoticAnalysisReasoning,
TimeComplexityReasoning,
SpaceComplexityReasoning,
WorstCaseReasoning,
AverageCaseReasoning,
AmortisedReasoning,
RecurrenceReasoning,
ComplexityClassReasoning,
ReductionReasoning,
HardnessReasoning,
CompletenessReasoning,
NPCompletenessReasoning,
ApproximationComplexityReasoning,
ParameterisedComplexityReasoning,
RandomisedComplexityReasoning,
ParallelComplexityReasoning,
LowerBoundReasoning,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"computational complexity" -> ComputationalComplexity
"algorithmic complexity" -> ComputationalComplexity
"time complexity" -> TimeComplexity
"space complexity" -> SpaceComplexity
"big O" -> BigO
"big omega" -> BigOmega
"big theta" -> BigTheta
"NP-hard" -> NPHard
"NP-complete" -> NPComplete
"fixed-parameter tractable" -> FixedParameterTractable
}
INTERPRETATION_ORDER = [
detect_computational_complexity_context,
identify computational_model_input_size_resource metric_and_analysis mode,
derive operation_memory_communication_or_query cost,
classify asymptotic growth,
if_recursive solve recurrence,
if_sequence based apply amortised analysis,
if_hardness_or_completeness construct_and_verify reduction,
if_parameterised identify parameter dependence,
if_randomised distinguish input distribution_from_algorithmic randomness,
validate quantifiers_bound direction_and_claim scope,
return semantic output
]
}
EXECUTION_RULES {
E1:
IF query_mentions("computational complexity")
OR algorithmic_resource_scaling_is_under_analysis
THEN activate(ComputationalComplexityOntology)
E2:
IF recurrence_is_present
THEN solve_with_appropriate recurrence method
E3:
IF repeated_operations_with_spikes
THEN consider AmortisedComplexity
E4:
IF hardness_claim_requested
THEN require explicit reduction
E5:
IF NP_complete_claim_requested
THEN require NP_membership_and_NP_hardness
E6:
IF large_numeric_values
THEN consider BitComplexity
E7:
IF parallel_algorithm
THEN report work_span_or_parallel depth_not_time alone
E8:
IF approximation_algorithm
THEN report approximation_ratio_and_runtime
E9:
IF parameterised_problem
THEN separate dependence_on_parameter_from_polynomial dependence_on_input size
}
RECURSION {
ENTRY = ComputationalComplexity
EXPAND(ComputationalComplexity) -> [
ComplexityAnalysis,
AlgorithmicComplexity,
InputSize,
ProblemSize,
TimeComplexity,
SpaceComplexity,
CommunicationComplexity,
ParallelComplexity,
QueryComplexity,
SampleComplexity,
BitComplexity,
ArithmeticComplexity,
WorkComplexity,
DepthComplexity,
WorstCaseComplexity,
AverageCaseComplexity,
BestCaseComplexity,
ExpectedComplexity,
AmortisedComplexity,
OutputSensitiveComplexity,
AsymptoticAnalysis,
BigO,
BigOmega,
BigTheta,
LittleO,
LittleOmega,
PolynomialTime,
ExponentialTime,
SubexponentialTime,
PseudopolynomialTime,
TractableProblem,
IntractableProblem,
ComplexityClass,
P,
NP,
coNP,
PSPACE,
EXPTIME,
L,
NL,
BPP,
RP,
ZPP,
NC,
Reduction,
PolynomialTimeReduction,
ManyOneReduction,
TuringReduction,
Hardness,
Completeness,
NPHard,
NPComplete,
PSPACEComplete,
LowerBound,
UpperBound,
DecisionProblem,
SearchProblem,
OptimisationProblem,
CountingProblem,
ApproximationAlgorithm,
ApproximationRatio,
PTAS,
FPTAS,
ParameterisedComplexity,
FixedParameterTractable,
FPT,
W1Hard,
Kernelisation,
RandomisedAlgorithm,
SmoothedAnalysis,
OracleModel,
RAMModel,
TuringMachineModel,
ComparisonModel
]
EXPAND(ResourceMeasures) -> [
TimeComplexity,
SpaceComplexity,
CommunicationComplexity,
ParallelComplexity,
QueryComplexity,
SampleComplexity,
BitComplexity,
ArithmeticComplexity
]
EXPAND(ComplexityClasses) -> [
P,
NP,
coNP,
PSPACE,
EXPTIME,
L,
NL,
BPP,
RP,
ZPP,
NC
]
STOP_CONDITION =
"Stop when computational model, input-size measure, resource function, asymptotic bound, analysis mode, reduction evidence, complexity class and parameterisation are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Computational Mathematics"
IMMEDIATE_CONTEXTS = [
"Computational Mathematics Ontology",
"Parallel Algorithms Ontology",
"High Performance Computing Ontology",
"Scientific Computing Ontology"
]
RELATED_ONTOLOGIES = [
"Computational Mathematics",
"Computational Mathematics Ontology",
"Parallel Algorithms Ontology",
"High Performance Computing Ontology",
"Scientific Computing Ontology",
"Numerical Linear Algebra Ontology",
"Discrete Mathematics Ontologies",
"Graph Algorithm Ontologies",
"Optimisation Ontologies",
"Operations Research Ontologies",
"Probability & Statistics Ontologies",
"Approximation Algorithm Ontologies",
"Parameterised Complexity Ontologies",
"Computability Ontologies"
]
ROUTE_RULES = [
"Computational Complexity -> Computational Mathematics for parent semantics",
"Computational Complexity -> Parallel Algorithms for work and depth",
"Computational Complexity -> High Performance Computing for practical scaling context",
"Computational Complexity -> Scientific Computing for solver cost models",
"Computational Complexity -> Numerical Linear Algebra for matrix algorithm complexity",
"Computational Complexity -> Discrete Mathematics and Graph Algorithms for combinatorial problems",
"Computational Complexity -> Optimisation and Operations Research for hard decision and optimisation problems",
"Computational Complexity -> Probability & Statistics for randomised and average-case analysis",
"Computational Complexity -> Approximation Algorithms for intractable optimisation",
"Computational Complexity -> Computability for decidability boundaries"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible complexity measures, classes or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve resource-scaling semantics.",
"Preserve computational-model dependence.",
"Preserve asymptotic-bound direction.",
"Preserve worst-average-expected-amortised distinctions.",
"Preserve hardness-versus-membership distinction.",
"Preserve NP-hard-versus-NP-complete distinction.",
"Preserve parameterised-complexity semantics.",
"Preserve machine-readable computational-complexity semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION =
"Computational complexity studies how computational resources required to solve problems grow with input size."
ASYMPTOTIC_SUMMARY =
"Big-O, Big-Omega and Big-Theta describe asymptotic upper, lower and tight bounds."
RESOURCE_SUMMARY =
"Complexity can measure time, space, communication, queries, samples, arithmetic operations, bits, work or parallel depth."
CASE_SUMMARY =
"Worst-case, average-case, expected and amortised analyses answer different resource questions."
CLASS_SUMMARY =
"Complexity classes group problems by resource bounds and computational models."
REDUCTION_SUMMARY =
"Reductions compare problem difficulty and underpin hardness and completeness results."
PARAMETERISED_SUMMARY =
"Parameterised complexity separates input-size growth from dependence on a chosen structural parameter."
APPROXIMATION_SUMMARY =
"Approximation complexity studies solution quality and runtime for problems where exact optimisation may be intractable."
VALIDATION_SUMMARY =
"Complexity claims should state the computational model, input-size measure, resource metric, quantifiers and reduction assumptions."
}
FLOW {
INPUT
-> detect_computational_complexity_context
-> identify problem_or_algorithm_computational model_input representation_and_input size
-> select time_space_communication_query_sample_bit_arithmetic_work_or_depth resource metric
-> derive recurrence_operation count_memory count_or_other resource function
-> simplify asymptotic growth
-> classify O_Omega_Theta_polynomial_exponential_or_other regime
-> distinguish worst_average_expected_amortised_outputSensitive_or_smoothed analysis
-> if_complexityClass determine membership evidence
-> if_hardness construct valid reduction
-> if_completeness verify membership_and_hardness
-> if_parameterised separate f(k)_from_polynomial n dependence
-> if_approximation record approximation ratio_and_runtime
-> validate model_bound_direction_quantifiers_and_claim scope
-> route to computational_mathematics parallel_algorithms high_performance_computing scientific_computing numerical_linear_algebra discrete_mathematics graph_algorithms optimisation operations_research probability_statistics approximation_algorithms parameterised_complexity_or_computability ontology
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Computational Complexity Ontology defines mathematical analysis of algorithmic resource requirements. It supports input size and problem size, time, space, communication, query, sample, bit, arithmetic, work and depth complexity, worst-case, average-case, expected, amortised and output-sensitive analysis, Big-O, Big-Omega, Big-Theta and little-o notation, polynomial, exponential, subexponential and pseudopolynomial time, tractability, complexity classes including P, NP, coNP, PSPACE, EXPTIME, L, NL, BPP, RP, ZPP and NC, polynomial reductions, hardness and completeness, NP-hard and NP-complete problems, lower and upper bounds, decision, search, optimisation and counting problems, approximation algorithms and schemes, parameterised complexity, FPT and kernelisation, randomised and smoothed analysis and multiple computational models."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-APPLIED-MATHEMATICS-COMPUTATIONAL-COMPLEXITY-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard