Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6818111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:08:12+00:00 2026-05-26T21:08:12+00:00

I have to solve the following optimization problem: Given a set of elements (E1,E2,E3,E4,E5,E6)

  • 0

I have to solve the following optimization problem:
Given a set of elements (E1,E2,E3,E4,E5,E6) create an arbitrary set of sequences e.g.

seq1:E1,E4,E3
seq2:E2
seq3:E6,E5

and given a function f that gives a value for every pair of elements e.g.

f(E1,E4) = 5
f(E4,E3) = 2
f(E6,E5) = 3
...

in addition it also gives a value for the pair of an element combined with some special element T, e.g.

f(T,E2) = 10
f(E2,T) = 3
f(E5,T) = 1
f(T,E6) = 2
f(T,E1) = 4
f(E3,T) = 2
...

The utility function that must be optimized is the following:
The utility of a sequence set is the sum of the utility of all sequences.
The utility of a sequence A1,A2,A3,…,AN is equal to
f(T,A1)+f(A1,A2)+f(A2,A3)+…+f(AN,T)
for our example set of sequences above this leads to

seq1: f(T,E1)+f(E1,E4)+f(E4,E3)+f(E3,T) = 4+5+2+2=13
seq2: f(T,E2)+f(E2,T) =10+3=13
seq3: f(T,E6)+f(E6,E5)+f(E5,T) =2+3+1=6
Utility(set) = 13+13+6=32

I try to solve a larger version (more elements than 6, rather 1000) of this problem using A* and some heuristic. Starting from zero sequences and stepwise adding elements either to existing sequences or as a new sequence, until we obtain a set of sequences containing all elements.
The problem I run into is the fact that while generating possible solutions I end up with duplicates, for example in above example all the following combinations are generated:

seq1:E1,E4,E3
seq2:E2
seq3:E6,E5
+
seq1:E1,E4,E3
seq2:E6,E5
seq3:E2
+
seq1:E2
seq2:E1,E4,E3
seq3:E6,E5
+
seq1:E2
seq2:E6,E5
seq3:E1,E4,E3
+
seq1:E6,E5
seq2:E2
seq3:E1,E4,E3
+
seq1:E6,E5
seq2:E1,E4,E3
seq3:E2

which all have equal utility, since the order of the sequences does not matter.
These are all permutations of the 3 sequences, since the number of sequences is arbitrairy there can be as much sequences as elements and a faculty(!) amount of duplicates generated…
One way to solve such a problem is keeping already visited states and don’t revisit them. However since storing all visited states requires a huge amount of memory and the fact that comparing two states can be a quite expensive operation, I was wondering whether there wasn’t a way I could avoid generating these in the first place.

THE QUESTION:
Is there a way to stepwise construct all these sequence constraining the adding of elements in a way that only combinations of sequences are generated rather than all variations of sequences.(or limit the number of duplicates)

As an example, I only found a way to limit the amount of ‘duplicates’ generated by stating that an element Ei should always be in a seqj with j<=i, therefore if you had two elements E1,E2 only

seq1:E1
seq2:E2

would be generated, and not

seq1:E2
seq2:E1

I was wondering whether there was any such constraint that would prevent duplicates from being generated at all, without failing to generate all combinations of sets.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:08:13+00:00Added an answer on May 26, 2026 at 9:08 pm

    Well, it is simple. Allow generation of only such sequences that are sorted according to first member, that is, from the above example, only

    seq1:E1,E4,E3
    seq2:E2
    seq3:E6,E5
    

    would be correct. And this you can guard very easily: never allow additional sequence that has its first member less than the first member of its predecessor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to solve the following problem. //pseudo algorithm you have four elements: elm1,
i'm not sure how to solve the following problem: i have a triangle with
I have the following problem that the standard library doesn't solve well, and I'm
I'm trying to solve the following problem: Say I have a Python script (let's
i wonder how i can solve the following problem. i have a horizontal scrollbar
Simplified, I have to solve the following problem: You have a 2-dimensional array filled
Is there a simple way to solve the following problem? I have an eclipse
I'm trying to solve the following problem: I have a download button that when
I am looking for a Pythonic way to solve the following problem. I have
How to solve the following problem? I have renamed a file from 'OldMailsCollection.aspx' to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.