Is TSP a more detailed form of the “Set Inclusion” question?


Set Inclusion

GIVEN: set of cards, some with blue backs, and each with a positive, integer face value.

QUESTION: Are there any [blue-backed cards] with a [face value <= L]?

  • 2 independent variables: [blue/white cards], [integer face values]

Function A: Select a blue-backed card

  • face value depends on which card you select
  • each blue card potentially has face value <= L
    • thus, worst-case = [check all blue cards]

Function B: Select a face value <= L

  • blue back depends on which card you select
  • each card w/ face value <= L potentially has blue back
    • thus, worst-case = [check all cards w/ face value <= L]

Function B cannot exist. There is no way to verify that a selected card has a blue back, since don’t know key info:

  • How are cards marked with a blue back?

WORST-CASE: turn over all blue-backed cards (Function A)


Travelling Salesman

GIVEN: complete graph, G(V,E), where all edges are positive, integer values.

DEFINITION: “config”

  • {A, B, u, v} where u & v are 2 vertices, and A & B are the remaining vertices split up as evenly as possible

DEFINITION: “optimal tour of a config”

  • shortest path from u to v, only going thru each vertex in A once, and
  • shortest path from v to u, only going thru each vertex in B once

Assume we have a function, f, that returns the optimal tour for a given config, in constant time.

A smallest tour must be the optimal tour of one of the configs in G.
Any config could produce the smallest tour.

NOTE: Each tour is an edge-set that can form |V|/2 or |V| configs, for even or odd |V|, respectively.


A COMPLETE GRAPH is equivalent to: set of cards, some with blue backs, and each with a positive, integer face value.

  • each card represents a set of edges with size = |V|
  • blue backs mark any edge-sets that are an optimal tour for a config
  • face value is the sum of the edge-set represented by the card

QUESTION: Are there any [blue-backed cards] with a [face value <= L]?

  • 2 independent variables: [blue/white cards], [integer face values]

Consider case where L = length of smallest tour.

  • Only need look at blue cards (edge-sets that are an optimal tour for a config)
  • Only need look at cards w/ face value = L (edge-sets with sum = L)

Function A: Select blue-backed card

  • face value depends on which card you select
  • each blue card potentially has face value = L
    • thus, worst-case = [check all blue cards]

Function B: Select a card with face value = L

  • blue back depends on which card you select
  • each card w/ face value = L potentially has blue back
    • thus, worst-case = [check all cards w/ face value = L]

Unlike “Set Inclusion”, now you can verify that a selected card for Function B has a blue back, by running f on the selected card’s configs.

However, controlling either variable, [choosing blue card] or [choosing card w/ face value = L], causes the other to be uncontrollable.

WORST-CASE:

  • FACE-DOWN Approach: turn over all cards with blue back (Function A)
  • FACE-UP Approach: turn over all cards with face value = L (Function B)

So the final question: Is TSP-Decision a version of “Set Inclusion” that has enough information to define a Function B?

If so, does this mean that the worst-case running time of TSP-Decision is lower-bounded by the smaller of the 2 domains of Functions A and B? i.e. min{number of blue cards, number of cards with face value = L} — still only for the case where L = length of smallest tour.

How print more than one page in VB?

What should i change in my code to see more than one page in Print preview and also print more than one page?

Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDoc.PrintPage     Static intStart As Integer     Dim font0 As New Font("arial", 24, FontStyle.Underline)     Dim fntText As Font = font0     Dim txtHeight As Integer     Dim LeftMargin As Integer = PrintDoc.DefaultPageSettings.Margins.Left     Dim TopMargin As Integer = PrintDoc.DefaultPageSettings.Margins.Top     txtHeight = PrintDoc.DefaultPageSettings.PaperSize.Height - PrintDoc.DefaultPageSettings.Margins.Top - PrintDoc.DefaultPageSettings.Margins.Bottom      Dim LinesPerPage As Integer = CInt(Math.Round(txtHeight / (fntText.Height + 0.025)))       e.Graphics.DrawRectangle(Pens.White, e.MarginBounds)     Dim intLineNumber As Integer     e.Graphics.DrawString("Support", font0, Brushes.Black, 75, 50)     For intCounter = intStart To lstLinesToPrint.Count - 1          e.Graphics.DrawString(lstLinesToPrint(intCounter), fntText, Brushes.Black, LeftMargin, fntText.Height * intLineNumber + TopMargin)         intLineNumber += 1         If intLineNumber > LinesPerPage - 1 Then             intStart = intCounter             e.HasMorePages = True             Exit For         End If      Next 

End Sub

more info>>http://www.reviewsforsupplement.com/trialix-male-enhancement/

This is the place Trialix may end up being useful. It might grow the components of nitric oxide to upgrade blood course and help you achieve all the more eagerly and more grounded erections. This could bolster the blood holding point of confinement of the penile chambers to empower you to last longer in the midst of intercourse.

http://www.reviewsforsupplement.com/trialix-male-enhancement/

How to create a block “Search: More like this” with my articles?

I noticed that in the context filter of the view, there was a filter “Search: More like this”. How to make it work? Is this the right solution ?

I have a tags field on my articles with taxanomy terms. I would like to retrieve the taxonomy terms from this field in the current page and use them as keywords to search the body and title of all articles. To view similar articles.

How to create a block “Search: More like this” with my articles ?

Add More Emojis to Recent Tab?

I tend to use a lot of emojis so the recent tab is a huge help. One day my recent tab had a whole big list of my recent emojis and disappeared a few days later.

This was very useful for me, and I have no clue how to get it back. By “tabs” I mean in the emoji section, theres presets you can click to bring you to specific categories of emojis (where the recent tab is located). I have also tried spamming emojis and nothing will bring the big list back.

I am currently using Google Keyboard with a Huawei phone.

If anyone can help or point me in the right direction as I can’t find anything about this. Thank you.

Is Android OS more friendly for PUBG Mobile or iOS?

enter image description here

It seems like even Snapdragon 600+ running Smartphones with 3GB plus RAM aren’t able to run PUBG Mobile properly. Is it that PUBG Corp is more interested in experimenting with new things and attracting malicious users like these https://www.techoleaksofficial.com/2019/01/best-smartphones-games-and-memes.html?m=1 instead of fixing bugs or Android OS has something to do with. As everyone cannot afford a Smartphone with Snapdragon 845+ chipset. This issue is faced by users worldwide yet no proper explanation is coming to the front. Or is it because of Apples A11 bionic chipset.

How to make this cypher more flexible and efficient

so I have been asked to make a cypher which can reverse the order of characters. Say “ajay” output “yaja”

so far i have used a very basic botched up code

 #include <iostream>  using namespace std;   int main() {     char a;     char b;     char c;     char d;      cout<< "enter word\n";     cin>>a;     cin>>b;     cin>>c; cin >>d;   cout<<d<<c<<b<<a;        return 0; } 

the code cannot work with lesser characters than 4 and obviously, it doesn’t work on characters greater than 4.

plus it just looks way too, crappy and direct. I have started coding from today itself so apologies in advance if the question doesn’t match the standards of the community.

More elegant way to express nested cats EitherT/OptionT code

We’ve got some rather unattractive code below that asynchronously looks to see if a value already exists, and if not performs a side effect. Ultimately resulting in a possible error.
it seems to me there must be a better way to do this than wrapping and unwrapping OptionTs. Any suggestions?

def persistValue(value: DtoA): EitherT[Future, Error, Unit] = ??? val maybeCachedValue: OptionT[Future, DataTypeA] = ???  val result: OptionT[Future, Error] = OptionT(   maybeCachedValue.value     .flatMap {       case Some(_) => Future.successful(None)       case None => persistValue(someDto).swap.toOption.value     } ) 

P.S. if someone with more reputation could create a scala-cats tag that would be great.

Javascript (Vanilla) – Check different values , and more values if a checkbox is checked

i want to get sure, that all fields are filled till the user gets to the next part of the form. If he checked “create account” the password fields are allso required. So i tried to proof this with a if statemant inside the function:

function checkit() { inputtx = document.getElementById(‘firstname’); inputlast = document.getElementById(‘lastname’);

 if (  inputtx.value.length == 0 ||  inputlast.value.length == 0    if (createcheck.checked == true){  ||  pwdone.value.length == 0 ||      pwdtwo.value.length == 0  

}

 )   {       alert("message");            return false;    }        return true;  }