Is dynamic programming restricted to optimization problems?

The usual criteria used to decide if a problem can be solved using dynamic programming is (1) if it has optimal sub-problems and (2) if it has overlapping sub-problems. Does the word “optimal” mean that DP can only be used to solve optimization problems? Otherwise, it would make more sense to write (1) as “if it can be decomposed in sub-problems” (i.e. it is recursive). Obviously, this definition includes optimization problems with optimal sub-problems.

Using decision oracle to solve optimization problem of maximum polyomino tiling

So, this problem is a kind of variant of polyomino packing which has been discussed frequently elsewhere, but I haven’t been able to find anything on my particular problem. Suppose we have a list of polyominos $ p_1, p_2, …, p_n$ (not necessarily distinct), and we want to find a tiling of a rectangle of dimension $ a \times b$ with $ a, b \leq n$ that maximizes the number of squares covered, where we can use each $ p_i$ at most once, and polyominos must be fully contained within the rectangle. Now, we have the decision problem which tells us, for a given $ t$ , if there is some tiling covering at least $ t$ squares, and the optimization problem which is finding a tiling that covers the maximum number of squares. There are two parts: first, if you can solve the optimization problem in polynomial time, can you solve the decision problem in polynomial time? And secondly, if you can solve the decision problem in polynomial problem, can you solve the optimization problem in polynomial time?

If we have an oracle that solves the optimization in polynomial time, solving the decision problem in polynomial time is easy. However, given an oracle for the decision problem, I was unable to find a way to solve the optimization problem in polynomial time. The main issue I’m facing is that the decision oracle only works for rectangular boards, which means we can’t just place pieces and then use the oracle to see if the placement works, since we won’t have a rectangular board if we want to exclude the piece we just placed. It isn’t hard to determine the actual maximum number of tiles you can cover, and you can even find the actual pieces you need to use, but I haven’t been able to figure out a way to find an arrangement of the pieces in polynomial time using the oracle. I assume there is some trick here, but I don’t see it.

Coding optimization

I am wondering if there is a book/course that, instead of giving good written code, it gives a bad/underoptimized code, explain why it’s bad/underoptimized and then gives a better approach.

PS : It can be pseudocode, python or C++ code

Would an optimization version of the 3-partition problem also be strongly np-complete / np-hard?

Anyone know if an optimization variant of the 3-partition problem (as explained there) would also be strongly np-complete?

This would be where the goal is to group a multiset whose size is evenly divisible by 3 into triplets that sum to as close to a target as possible and to produce this grouping. This would not be a decision problem but an actual optimization problem.

is the complexity of an algorithm connected to the “classification” of a optimization problem?

I wonder if the complexity is connected to an optimization problem. In general but also specifically e.g. when having a look at $ O(n^2) $ . Does this just describe the complexity in general or does it also mean does the underlying algorithm has to be a nonlinear optimization problem? Or is it also valid for linear tasks?

In simple words: Can a nonlinear task be solved in $ O(n) $ ?

Cities/Countries Autocomplete query optimization

I have Cities and Countries tables, based on Geonames data. I’m trying to implement an autocomplete function, but so far it doesn’t work as I intend it to.

CREATE INDEX gin_pgtrm_testcity_big_index ON testcity_big USING gin ((name || ' ' || asciiname || ' ' || alternatenames) COLLATE pg_catalog."default"  gin_trgm_ops);  CREATE INDEX gin_pgtrm_tescountry_big_index ON testcountry_big USING gin ((name) COLLATE pg_catalog."default" gin_trgm_ops);  SELECT     country.name AS country,     city.name AS city,     city.population AS city_population,     city.fcode AS fscode,      similarity(coalesce(country.name,'')                  || coalesce(city.name,'')                  || coalesce(city.asciiname,'')      ,'%ribe dk%) AS rank  FROM testcountry_big country JOIN testcity_big city ON city.country = country.iso_alpha2  WHERE similarity(coalesce(country.name,'')                      || coalesce(city.name,'')                      || coalesce(city.asciiname,'')      ,'%ribe dk%') > 0.15  AND fcode ~ '\yPPLC\y|\yPPLA\y|\yPPLA2\y|\yPPL\y|\yHMSD\y' ORDER BY rank DESC LIMIT 5; 

1. I cannot return country only. My current query retrieves cities only, for example for “New York United States” I get 4 different cities, but I’m not getting United States country, and I can’t understand how to make it work for all possible combinations: cities, countries , cities+countries.

2. This query performs too slow for an autocomplete function – around 0.5 seconds.

(a) should I add a Materialized View to help boost the performance?

(b) could it be so slow simply because I’m using a local machine (laptop) and the performance on a real server is expected to be better?

** I also tried working with tsvector here, but :

  1. unfortunately they only work for whole words and not substrings
  2. the performance seemed worse than with triagrams
  3. the similarity function using triagrams gives the ability for the users to be more “loose” with the queries, and get results even when they have a typo.

Multiple parameters in optimization [on hold]

Consider a scenario where I have multiple unique balls of different sizes and weights. The problem is to identify the maximum number of balls which can fit into a bucket B given the following constraints:

  1. The algorithm should pick up the largest sized ball amongst all available balls.
  2. The total weight of all balls should not exceed the capacity of the bucket.
  3. There should be minimal wastage of capacity, as we fit balls into the bucket

eg: If we have 5 balls of sizes and weights as follows {4, 5},{6, 25}, {7, 18}, {5, 50},{10, 80} and a bucket of size, weight as {25,100} An optimal algorithm, as manually done by me will be: {7,18},{6,25},{5,50},{4,5}

l’ll do Shopify Store SEO optimization, Product Tags, Meta Description, Alt Tags and Schema Markup for $20

Shopify Store SEO optimization is the process of optimizing each and every product and page of your store in order to rank higher in the Search Engine Results Pages (SERPS). If you want to enhance Shopify Store ranking, organic web traffic and sales, you simply can’t ignore search engine optimization(SEO). This White Hat on page SEO services can boost google ranking of your Shopify Store or Store traffic by 90% or more. Our on page SEO optimization services include: Free: Shopify Store SEO analysis and Store SEO audit report.LSI, Focused & Long tail keywords Optimization.Install & configure necessary store apps.Compelling Meta descriptions, SEO Meta Titles and Product tags.Heading tags (H₁, H₂, H₃), Image alt tags and Shopify store Speed Optimization.Fix duplicate content & Redirect Broken Links to the Homepage or Parent Page.Social media Meta tags, Hyperlink and anchor text optimization.Search Engines friendly URLs and SEO Titles.Schema Markup, XML Sitemaps, Internal / External Linking and Robots.txt.Webmaster Tools(Google, Bing, Yahoo) & Google analytics. Why us? 100% Client Satisfaction and Money back Guarantee.Increased store authority.Top-ranked website based SEO keywords research.100% White Hat manual work.WordPress SEO, Wix SEO and Shopify Store SEO Specialists.If you have any questions, please don’t hesitate to get in touch. Tags: Shopify SEO, Shopify store SEO, e-commerce store SEO, store optimization, SEO services, Store SEO analysis, Shopify store SEO optimization, Shopify store SEO ranking, Shopify store on page SEO optimization, Shopify store SEO services, Shopify store SEO specialist, Shopify store SEO agency, Shopify store SEO consultant, Product Tags, SEO keyword research, LSI keywords research, Keywords analysis, Shopify store SEO Audit Report, Shopify store SEO audit, 301 redirect, Competitor analysis, Meta descriptions, image alt tags, Shopify store speed optimization, XML sitemap, robots file, hyper link optimization, anchor text optimization, SEO friendly titles, long tail keywords research and Targeted Organic Traffic.

by: ONELIFESEO
Created: —
Category: Local SEO
Viewed: 197


I Can Do SEO off page optimization 230 domains with 30+ Domain Authority Backlinks for $40

I am having 5+ years experience in doing White Hat link building, OFF-Page Techniques, Keyword research, Competitor analysis, Content Writing, Link Building Campaign, Lead Generation, and other marketing techniques. **Off-Page :-** ================= will have huge positive impact on rankings. What you will get in this package? 100 Blog comments 10 niche blog comments 50 Article submission 20 web2.0 10 guest post 10 press release 5 classified 5 google map citation 5 image sharing 5 forum posting 10 profile 1 free rewritten/spinned article of your website niche that we will use for article and web 2.0 posts Features of this service: 100% manual and white hat work High authority backlinks to your website/blog Mix of no-dofollow, anchored and brand links Order Now to enjoy my service Please contact me if you have any doubt about the work. I am always here to help you out!

by: ShaikhAhmed2
Created: —
Category: Link Building
Viewed: 203