-
Notifications
You must be signed in to change notification settings - Fork 391
Document adversarial temporal graph problem statement #801
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
Open
shubuexe
wants to merge
5
commits into
codemistic:main
Choose a base branch
from
shubuexe:Adversarial-Temporal-Graph-with-Stateful-Encodin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| Problem: Adversarial Temporal Graph with Stateful Encoding | ||
|
|
||
| Problem Statement | ||
| You are given: | ||
| A directed graph with n nodes (0 → n-1) | ||
| Each edge has: | ||
| cost (energy consumption) | ||
| time (time taken) | ||
| label (a lowercase character 'a'–'z') | ||
| An integer K (max energy) | ||
| An integer T (max time) | ||
| An integer M (modulo) | ||
| A forbidden pattern string P | ||
|
|
||
| Rules | ||
|
|
||
| You start at node 0 and want to reach node n-1. | ||
|
|
||
| You maintain: | ||
|
|
||
| 1. ⏱ Time | ||
| Total time ≤ T | ||
|
|
||
| 3. ⚡ Energy | ||
| Total energy ≤ K | ||
|
|
||
| 4. 🔐 Stateful Encoding | ||
| Each path generates a value: | ||
| 𝑣𝑎𝑙𝑢𝑒=(((0⋅131+𝑐1)⋅131+𝑐2)⋯) mod 𝑀 | ||
|
shubuexe marked this conversation as resolved.
Outdated
|
||
|
|
||
| 5. 🚫 Forbidden Pattern Constraint | ||
| The concatenated labels along your path must NOT contain P as a substring. | ||
|
|
||
|
shubuexe marked this conversation as resolved.
|
||
| 5. 🔁 Temporal Edge Activation | ||
| Each edge (u → v) is only usable at certain times: | ||
| You are given for each edge: | ||
| A list of active intervals [l, r] | ||
| You can traverse the edge only if current time ∈ any interval | ||
|
|
||
|
shubuexe marked this conversation as resolved.
Outdated
|
||
| 7. 🎭 Adversarial Twist | ||
| At each node, an adversary can flip one outgoing edge’s label to any character (once per node visit). | ||
| You must assume the adversary acts to minimize your final value | ||
| You still try to maximize the final value | ||
|
shubuexe marked this conversation as resolved.
Outdated
|
||
|
|
||
|
shubuexe marked this conversation as resolved.
|
||
| Objective | ||
| Return the maximum possible encoded value you can guarantee under worst-case adversarial behavior. | ||
| If no valid path exists, return -1 | ||
|
|
||
| Constraints | ||
| 1 ≤ n ≤ 100 | ||
| 1 ≤ edges ≤ 500 | ||
| 1 ≤ K ≤ 5000 | ||
| 1 ≤ T ≤ 5000 | ||
| |P| ≤ 50 | ||
| Active intervals per edge ≤ 10 | ||
|
|
||
| Example 1: | ||
| n = 3 | ||
| edges: | ||
| 0 → 1 (cost=2, time=2, label='a', active=[0,10]) | ||
| 1 → 2 (cost=2, time=2, label='b', active=[0,10]) | ||
|
|
||
| K = 5 | ||
| T = 5 | ||
| M = 1000 | ||
| P = "ab" | ||
|
|
||
| Example 2: | ||
| n = 3 | ||
| edges: | ||
| 0 → 1 (cost=1, time=1, label='a', active=[0,10]) | ||
| 1 → 2 (cost=1, time=1, label='c', active=[0,10]) | ||
|
|
||
| K = 5 | ||
| T = 5 | ||
| M = 1000 | ||
| P = "ab" | ||
|
shubuexe marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.