Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Xiaomi’s Leica Edition flagship confirmed for new global release

    Apple iPad Pro unlikely to get major update for years despite stronger-than-ever competition

    This sleek all-black Citizen Eco-Drive dress watch is 54% off right now

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Wall Street Moves Into Prediction Markets With Election-Contract ETF Filings

      February 18, 2026

      Tectonic to Host Inaugural Quantum Summit at ETHDenver 2026 Focused on Post-Quantum Cryptography Readiness for Web3

      February 18, 2026

      Ki Young Ju Says Bitcoin May Need to Hit $55K Before True Recovery Begins

      February 18, 2026

      MYX Finance Is Oversold For The First Time Ever, Yet No Relief In Sight

      February 18, 2026

      Everyone is Talking about the SaaSpocalypse, But Why Does it matter for Crypto?

      February 18, 2026
    • Technology

      Xiaomi’s Leica Edition flagship confirmed for new global release

      February 18, 2026

      Apple iPad Pro unlikely to get major update for years despite stronger-than-ever competition

      February 18, 2026

      This sleek all-black Citizen Eco-Drive dress watch is 54% off right now

      February 18, 2026

      Google’s new smartphone confirmed to launch globally with old Tensor G4 silicon on eve of release

      February 18, 2026

      Nintendo’s VR accessory for the Switch 2 is finally available

      February 18, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Twentyseven 1.0
    Technology

    Twentyseven 1.0

    TechAiVerseBy TechAiVerseAugust 2, 2025No Comments5 Mins Read2 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Twentyseven 1.0

    Posted on August 1, 2025

    Twelve years of Haskell

    Twentyseven
    is a Rubik’s cube solver and one of my earliest projects in Haskell.
    The first commit dates from January 2014, and version 0.0.0 was uploaded on Hackage in March 2016.

    I first heard of Haskell in a course on lambda calculus in 2013.
    A programming language with lazy evaluation sounded
    like a crazy idea, so I gave it a try.
    Since then, I have kept writing in Haskell as my favorite language.
    For me it is the ideal blend of programming and math.
    And a Rubik’s cube solver is a great excuse for doing group theory.

    Twentyseven 1.0.0 is more of a commemorative release for myself,
    with the goal of making it compile with the current version of GHC (9.12).
    There was surprisingly little breakage:

    1. Semigroup has become a superclass of Monoid
    2. A breaking change in the Template Haskell AST

    Aside from that, the code is basically just as it was 9 years ago,
    including design decisions that I would find questionable today.
    For example, I use unsafePerformIO to read precomputed tables
    into top-level constants, but the location of the files to read from
    can be configured by command-line arguments, so I better make sure that
    the tables are not forced before the location is set…

    How Twentyseven works

    The input of the program is a string enumerating the 54 facelets
    of a Rubik’s cube, each character represents one color.

    DDDFUDLRB FUFDLLLRR UBLBFDFUD ULBFRULLB RRRLBBRUB UBFFDFDRU

    The facelets follow the order pictured below. They are grouped
    by faces (up, left, front, right, back, top), and in each face
    they are listed in top-down, left-right order.

                      00 01 02
                      03 04 05
                      06 07 08
    
            10 11 12  20 21 22  30 31 32  40 41 42
            13 14 15  23 24 25  33 34 35  43 44 45
            16 17 18  26 27 28  36 37 38  46 47 48
    
                      50 51 52
                      53 54 55
                      56 57 58

    The output is a sequence of moves to solve that cube.

    U L B' L R2 D R U2 F U2 L2 B2 U B2 D' B2 U' R2 U L2 R2 U

    The implementation of Twentyseven is based on Herbert Kociemba’s notes
    about Cube Explorer
    , a program written in Pascal!

    The search algorithm is iterative deepening A*, or IDA*. Like A*, IDA* finds
    the shortest path between two vertices in a graph.
    A conventional A* is not feasible because the state space of a Rubik’s cube is massive (43 252 003 274 489 856 000 states,
    literally billions of billions).
    Instead, we run a series of depth-first searches
    with a maximum allowed number of moves that increases for each search.
    As it is based on depth-first search,
    IDA* only needs memory for the current path,
    which is super cheap.

    IDA* relies on an estimate of the number of moves remaining
    to reach the solved state. We obtain such an estimate by
    projecting the Rubik’s cube state into a simpler puzzle.
    For example, we can consider only the permutation of corners,
    ignoring their orientation.
    We can pre-compute a table mapping each corner permutation
    (there are 8! = 40320) to the minimum
    number of moves to put the corners back to their location.
    This is a lower bound on the number of moves to actually solve a Rubik’s cube.
    Different projections yield different lower bounds (for example, by
    looking at the permutation of edges instead, or their orientation),
    and we can combine lower bounds into their maximum,
    yielding a more precise lower bound, and thus a faster IDA*.

    Putting all that together, we obtain an optimal solver for Rubik’s cubes.
    But even with these heuristics, Twentyseven can take hours to solve a random cube optimally.
    Kociemba’s Cube Explorer is apparently much faster
    (I’ve never tried it myself).
    My guess is that the difference is due to a better selection of projections,
    yielding better heuristics.
    But I haven’t gotten around to figure out whether I’ve misinterpreted
    his notes or those improvements can only be found in the code.

    A faster alternative is Kociemba’s two phase algorithm.
    It is suboptimal, but it solves Rubik’s cubes in a fraction of a second
    (1000 cubes per minute).
    The first phase puts cubies into a “common orientation”
    and “separates” the edges into two groups.
    In other words, we reach a state where the permutation
    of 12 edges can be decomposed into two disjoint
    permutations of 4 and 8 edges respectively.
    In the second phase, we restrict the possible moves:
    quarter- and half-turns on the top and bottom faces,
    half-turns only on the other faces.
    These restricted moves preserve the “common orientation” of edges and corners
    from phase 1,
    and the edges in the middle slice stay in their slice.
    Each phase thus performs an IDA* search in a much smaller space
    than the full Rubik’s cube state space (2 217 093 120 and 19 508 428 800
    states respectively).

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleCerebras Code
    Next Article AI-enabled security pushes down breach costs for UK organisations
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Xiaomi’s Leica Edition flagship confirmed for new global release

    February 18, 2026

    Apple iPad Pro unlikely to get major update for years despite stronger-than-ever competition

    February 18, 2026

    This sleek all-black Citizen Eco-Drive dress watch is 54% off right now

    February 18, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025683 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025272 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025155 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025114 Views
    Don't Miss
    Technology February 18, 2026

    Xiaomi’s Leica Edition flagship confirmed for new global release

    Xiaomi’s Leica Edition flagship confirmed for new global release – NotebookCheck.net News ⓘ XiaomiThe Leica…

    Apple iPad Pro unlikely to get major update for years despite stronger-than-ever competition

    This sleek all-black Citizen Eco-Drive dress watch is 54% off right now

    Google’s new smartphone confirmed to launch globally with old Tensor G4 silicon on eve of release

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Xiaomi’s Leica Edition flagship confirmed for new global release

    February 18, 20263 Views

    Apple iPad Pro unlikely to get major update for years despite stronger-than-ever competition

    February 18, 20264 Views

    This sleek all-black Citizen Eco-Drive dress watch is 54% off right now

    February 18, 20263 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.