Algorithms and Data Structures

Generic algorithms and data structures.

See also:

Organizations

Resources

Sorting

Wikipedia: Sorting algorithm

NP-complete Problems

Wikipedia: NP-complete problems cannot be solved in polynomial time complexity and often have to be inexactly solved using heuristics.

Traveling salesman problem

Wikipedia: Traveling salesman problem

  • SortingLab.jl : Julia package for simple traveling salesman problem heuristics.

Boolean satisfiability problem (SAT)

Wikipedia: SAT is a kind of NP-complete (NPC) problems.

General data structures

  • Air.jl : an immutable data structure and software transactional memory tool for Julia.
  • DataStructures.jl : Julia implementation of Data structures.
  • Interfaces.jl : Macros to define and implement interfaces, to ensure they are checked and correct. JuliaCon 2024 video
  • LRUCache.jl : An implementation of a Least Recently Used (LRU) Cache.
  • RingBuffers.jl : A simple non-allocating circular RingBuffer type, with configurable overflow and underflow handling.
  • TypeSortedCollections.jl : It provides the TypeSortedCollection type, which can be used to store type-heterogeneous data in a way that allows operations on the data to be performed in a type-stable manner.

Function object

Result types

  • ResultTypes.jl : A Result type for returning a value or an error in a type-stable manner without throwing an exception.
  • ErrorTypes.jl : A simple implementation of Rust-like error handling in Julia.

Composite Data Types

Wikipedia: Composite Data Types

  • Base.@kwdef : a concise struct construction in the Julia base.

  • Bijections.jl : Bijection datatype for Julia that blocks assigning the same value to two different keys.
  • ConcreteStructs.jl : @concrete can be used to make non-concrete structs concrete without the boilerplate of adding type parameters.
  • Dictionaries.jl : An alternative interface for dictionaries Dict in Julia, for improved productivity and performance.
  • DispatchedTuples.jl : Dispatched Tuples are like immutable dictionaries (so, they’re technically more like NamedTuples) except that the keys are instances of types. Also, because DispatchedTuples are backed by tuples, they are GPU-friendly.
  • TypeParams.jl : keeping compile-time type information in struct for better performance.
  • OrderedCollections.jl: Julia implementation of associative containers that preserve insertion order.

Accessing elements

  • Accessors.jl : updating immutable data simple. It is the successor of Accessors.jl.
  • Parameters.jl : Types with default field values, keyword constructors and (un-)pack macros.
  • SimpleUnPack.jl : Lightweight Julia macro for destructuring properties and fields. (Requires Julia >= 1.7)
  • UnPack : @unpack some or all of the fields of a type, and @pack, in the case of mutable data types.