Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a problem mask for QUBO problems #31

Merged
merged 3 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/landing-page/ProblemCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProblemCard = (props: ProblemCardProps) => {
<Box display="flex" alignItems="baseline">
{props.new && (
<Badge borderRadius="full" px="2" colorScheme="blue" mr="2">
New
New!
</Badge>
)}
<Box
Expand Down
11 changes: 10 additions & 1 deletion src/components/landing-page/ProblemChooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ export const ProblemChooser = (props: GridProps) => (
new={false}
tags={["sub-routines"]}
problemName="Feature Model Anomaly"
description="For a given feature model, check for Void Feature Model, Dead Features, False-Optional Features, Redundant Constraints.."
description="Check whether a given feature model in the UVL format is void or if it has dead features."
/>
</GridItem>
<GridItem>
<ProblemCard
href="solve/QUBO"
new={true}
tags={["QAOA"]}
problemName="QUBO"
description="For a quadratic term with binary decision variables, find the variable assignment minimizing the term."
/>
</GridItem>
</Grid>
Expand Down
42 changes: 42 additions & 0 deletions src/pages/solve/QUBO.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Head from "next/head";
import React, { useState } from "react";
import type { NextPage } from "next";
import { TextInputMask } from "../../components/solvers/TextInputMask";
import { ProgressHandler } from "../../components/solvers/ProgressHandler";
import { Text, Divider, Heading, Spacer, Code } from "@chakra-ui/react";
import { Layout } from "../../components/layout/Layout";

const QUBO: NextPage = () => {
const [quboTerm, setQuboTerm] = useState("");

return (
<Layout>
<Head>
<title>ProvideQ</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
{/* TODO: replace favicon */}
</Head>

<Heading as="h1">QUBO Solver</Heading>
<Text color="text" align="justify">
In the Quadratic Unconstrained Binary Optimization problem, we try to
find the assignment for a finite amount of <Code>0/1</Code> decision
variables that minimizes a given quadratic term with these variables.
The problem statement is given in the LP format and all solvers will
present a variable assigment as a solution.
</Text>

<Spacer />

<TextInputMask
onTextChanged={setQuboTerm}
textPlaceholder={"Enter your QUBO problem in LP format"}
/>
<Divider />
<ProgressHandler problemTypes={["qubo"]} problemInput={quboTerm} />
</Layout>
);
};

export default QUBO;