combinatorics
Permute all unique enumerations of a vector in R
I\'m trying to find a function that will permute all the unique permutations of a vector, while not counting juxtapositions within subsets of the same element type. For example:[详细]
2023-02-24 17:17 分类:问答Bounding the number of edges between star graphs such that graph is planar
I have a graph G which consists only of star graphs.A star graph consists of one central node having edges to every other node in it.Let H1, H2,…,Hn be different star graphs of different sizes[详细]
2023-02-22 09:25 分类:问答Recursive C++ Combinatorics: Not sure how to get the results in order
I have a function to print all of the ternary string combinations from length 0 to length n: void TerString(int len,string input){[详细]
2023-02-17 17:25 分类:问答How to calculate the index (lexicographical order) when the combination is given
I know that there is an algorithm that permits, given a combination of number (no repetitions, no order), calculates the index of the lexicographic order.[详细]
2023-02-17 00:39 分类:问答Recursively spell out a word
I was given this: Write a recursive program that, given a string with no spaces in it, breaks it into every possible segmentation of the string into \"words\". That is, print out every possible vers[详细]
2023-02-16 11:06 分类:问答Travelling salesman with repeat nodes & dynamic weights
Given a list of cities and the cost to fly between each city, I am trying to find the cheapest itinerary that visits all of these cities. I am currently using a MATLAB solution to find the cheapest ro[详细]
2023-02-16 04:07 分类:问答Cartesian product of a dictionary of lists
I\'m trying to write some code to test out the Cartesian product of a bunch of input parameters. I\'ve looked at itertools, but its product function is not exactly what I want. Is there a simple obvi[详细]
2023-02-15 16:04 分类:问答Multinomial sets
I\'m having a problem figuring out this problem, it is similar to combining sets of non-unique letters, but is slightly different.[详细]
2023-02-14 06:48 分类:问答How to generate cross product of sets in specific order
Given some sets (or lists) of numbers, I would like to iterate through the cross product of these sets in the order determined by the sum of the returned numbers. For example, if the given sets are {[详细]
2023-02-14 04:47 分类:问答Pascal Triangle Recursive Program optimization in C++
I have built recursive function to compute Pascal\'s triangle values. Is there a way to optimize it?[详细]
2023-02-13 04:56 分类:问答