> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# solve_graph

<div className="kinetica-typedoc">
  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="solve_graph"><span>solve\_graph</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="solve_graph-1"><span className="tsd-kind-call-signature">solve\_graph</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">graph\_name</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">weights\_on\_edges</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">restrictions</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">solver\_type</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">source\_nodes</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">destination\_nodes</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">solution\_table</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">options</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/javascript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/javascript/interfaces/SolveGraphResponse" className="tsd-signature-type tsd-kind-interface">SolveGraphResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Solves an existing graph for a type of problem (e.g., shortest path, page rank, traveling salesman, etc.) using source nodes, destination nodes, and additional, optional weights and restrictions.</p>
            <p>IMPORTANT: It's highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /solve/graph examples before using this endpoint.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">graph\_name</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Name of the graph resource to solve.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">weights\_on\_edges</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Additional weights to apply to the edges of an existing graph. Weights must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS WEIGHTS\_EDGE\_ID', expressions, e.g., 'ST\_LENGTH(wkt) AS WEIGHTS\_VALUESPECIFIED', or constant values, e.g., '{"{"}4, 15, 2{"}"} AS WEIGHTS\_VALUESPECIFIED'. Any provided weights will be added (in the case of 'WEIGHTS\_VALUESPECIFIED') to or multiplied with (in the case of 'WEIGHTS\_FACTORSPECIFIED') the existing weight(s). If using constant values in an identifier combination, the number of values specified must match across the combination.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">restrictions</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS RESTRICTIONS\_EDGE\_ID', expressions, e.g., 'column/2 AS RESTRICTIONS\_VALUECOMPARED', or constant values, e.g., '{"{"}0, 0, 0, 1{"}"} AS RESTRICTIONS\_ONOFFCOMPARED'. If using constant values in an identifier combination, the number of values specified must match across the combination. If remove\_previous\_restrictions option is set to true, any provided restrictions will replace the existing restrictions. Otherwise, any provided restrictions will be added (in the case of 'RESTRICTIONS\_VALUECOMPARED') to or replaced (in the case of 'RESTRICTIONS\_ONOFFCOMPARED').</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">solver\_type</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>The type of solver to use for the graph.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">source\_nodes</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>It can be one of the nodal identifiers - e.g: 'NODE\_WKTPOINT' for source nodes. For BACKHAUL\_ROUTING, this list depicts the fixed assets.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">destination\_nodes</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>It can be one of the nodal identifiers - e.g: 'NODE\_WKTPOINT' for destination (target) nodes. For BACKHAUL\_ROUTING, this list depicts the remote assets.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">solution\_table</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Name of the table to store the solution, in \[schema\_name.]table\_name format, using standard name resolution rules.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">options</span>: <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Additional parameters.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/javascript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/javascript/interfaces/SolveGraphResponse" className="tsd-signature-type tsd-kind-interface">SolveGraphResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.SolveGraphResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L14457">src/GPUdb.ts:14457</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>

  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="solve_graph_request"><span>solve\_graph\_request</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="solve_graph_request-1"><span className="tsd-kind-call-signature">solve\_graph\_request</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">request</span><span className="tsd-signature-symbol">:</span> <a href="/content/api/javascript/interfaces/SolveGraphRequest" className="tsd-signature-type tsd-kind-interface">SolveGraphRequest</a><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/javascript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/javascript/interfaces/SolveGraphResponse" className="tsd-signature-type tsd-kind-interface">SolveGraphResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Solves an existing graph for a type of problem (e.g., shortest path, page rank, traveling salesman, etc.) using source nodes, destination nodes, and additional, optional weights and restrictions.</p>
            <p>IMPORTANT: It's highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /solve/graph examples before using this endpoint.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">request</span>: <a href="/content/api/javascript/interfaces/SolveGraphRequest" className="tsd-signature-type tsd-kind-interface">SolveGraphRequest</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Request object containing the parameters for the operation</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/javascript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/javascript/interfaces/SolveGraphResponse" className="tsd-signature-type tsd-kind-interface">SolveGraphResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.SolveGraphResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L14395">src/GPUdb.ts:14395</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.