<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>invariant - dynamic-programming</title>
    <subtitle>Essays on algorithms and data structures by Ali Khalilli. Binary search, numerical methods, dynamic programming, graphs, strings.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://invariant.khalilli.ai/tags/dynamic-programming/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://invariant.khalilli.ai"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2022-06-18T00:00:00+00:00</updated>
    <id>https://invariant.khalilli.ai/tags/dynamic-programming/atom.xml</id>
    <entry xml:lang="en">
        <title>Jump Game</title>
        <published>2022-06-18T00:00:00+00:00</published>
        <updated>2022-06-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              alikhalilli
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://invariant.khalilli.ai/blog/jump-game/"/>
        <id>https://invariant.khalilli.ai/blog/jump-game/</id>
        
        <summary type="html">
&lt;link rel=&quot;stylesheet&quot; href=&quot;https:&#x2F;&#x2F;invariant.khalilli.ai&#x2F;admonition.css?h=98c1477488c4b2c9d71a&quot; type=&quot;text&#x2F;css&quot;&gt;

&lt;div
  class=&quot;my-4 flex flex-col rounded-lg bg-(--admonition-bg)&quot;
  style=&quot;--admonition-bg: var(--admonition-question);&quot;
&gt;
  &lt;div class=&quot;flex items-center rounded-t-lg bg-(--admonition-bg) p-1&quot;&gt;
    &lt;div
      class=&quot;mx-2 h-4 w-4 text-[0px] [background:var(--url)_center_center_no-repeat] dark:invert&quot;
      style=&quot;--url: url(icons&#x2F;question.svg);&quot;
    &gt;
      question
    &lt;&#x2F;div&gt;
    &lt;span&gt;&lt;strong&gt;Problem&lt;&#x2F;strong&gt;&lt;&#x2F;span&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;pl-4&quot;&gt;&lt;p&gt;Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. You can assume that you can always reach the last index.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Floyd–Warshall</title>
        <published>2022-05-28T00:00:00+00:00</published>
        <updated>2022-05-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              alikhalilli
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://invariant.khalilli.ai/blog/floyd-warshall/"/>
        <id>https://invariant.khalilli.ai/blog/floyd-warshall/</id>
        
        <summary type="html">&lt;p&gt;When I saw this algorithm for a first time, It reminded me &lt;strong&gt;the Matrix Chain Multiplication&lt;&#x2F;strong&gt;, so therefore didn’t think about that much “how does it work?”, “why does it work?”.
Because, MCM problem seems much more interval DP(anyway, it’s acyclic DAG) because of it’s vibe of linearity.&lt;br&#x2F;&gt;
Let’s think the problem gradually from simpler to harder, 1. graph is completely linear OR topologically sorted, 2. graph nodes have all the connections pairwise.
For simplicity, let’s look at linear graph model.&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Optimal Game Strategy</title>
        <published>2022-02-17T00:00:00+00:00</published>
        <updated>2022-02-17T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              alikhalilli
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://invariant.khalilli.ai/blog/optimal-game-strategy/"/>
        <id>https://invariant.khalilli.ai/blog/optimal-game-strategy/</id>
        
        <summary type="html">&lt;p&gt;Some of the well-known CS problems, such as the choosing of an optimal game strategy, may appear to be mentally exhausting at first glance. However, like with other problems, it necessitates a certain point of view from which we must examine it. First and foremost, let us define the problem:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is a game for two players. There are an even amount of coins placed in a row, hence the row is even. There will be alternating turns. Each round, a player has the option of selecting either the first coin in the row or the last coin in the row and keeping it in his possession. If a player moves first, the goal of the issue is to figure out how much money he or she can earn with certainty up to the greatest amount conceivable.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;</summary>
        
    </entry>
</feed>
